79159680

Date: 2024-11-05 15:16:00
Score: 0.5
Natty:
Report link

I have created a silly workaround to run and build the docker image inside the docker compose, I used maven so you can replace accordingly with gradle, the concept is not complete but actually might show a way how to use just docker compose up to also build your image in behind via anything (docker in docker :-))

  context: ../MyService
  dockerfile_inline: |
    FROM ubi9:latest
    ENV DOCKER_HOST=tcp://127.0.0.1:2375
    RUN yum install -y yum-utils
    RUN yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
    RUN yum install docker-ce-cli -y
    COPY . .
    RUN --mount=type=cache,target=/root/.m2/repository mvn compile jib:dockerBuild
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: morapet