Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

515
Views
Uso de fabric8 docker-maven-plugin para crear imágenes en un demonio docker remoto

Estoy intentando usar el complemento docker-maven-plugin de fabric8 para crear imágenes acoplables dentro de mi canalización gitlab ci.

Fondo:

La etapa de creación de mi imagen en gitlab-ci.yml se ve así:

 build_image: stage: build image: $JAVA_IMAGE services: - name: docker:dind alias: docker-build script: - ./mvnw docker:build allow_failure: true except: *nobuild tags: - autoscaler

mi pom tiene

 <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.30.0</version> <configuration> <!-- the hostname should be the same as the service alias specified in the gitlab ci file--> <dockerHost>tcp://docker-build:2375</dockerHost> <images> <image> <name>my-image</name> <build> <contextDir>${project.basedir}/path/where/Dockerfile/lives</contextDir> <filter>false</filter> <tags> <tag>latest</tag> <tag>${project.version}</tag> </tags> </build> </image> </images> </configuration> </plugin>

Y mi Dockerfile contiene

 COPY ./some/directory/ /destination/path/within/image

Pero la compilación falla con el error.

 41014 [ERROR] DOCKER> Unable to build image [my-image] : "COPY failed: stat /var/lib/docker/tmp/docker-builder785340074/some/directory/: no such file or directory" ["COPY failed: stat /var/lib/docker/tmp/docker-builder785340074/some/directory/: no such file or directory" ]

Pregunta:

El problema parece ser que Maven, dentro del contenedor construido a partir de $JAVA_IMAGE , está usando el demonio docker del contenedor docker:dind (en tcp://docker-build:2375 ) para construir my-image (como se esperaba), pero el docker:dind container no tiene acceso a los archivos en el contenedor $JAVA_IMAGE en ./some/directory/ . ¿Hay alguna forma de darle acceso a esos archivos o de copiar esos archivos en el contenedor docker:dind ? ¿O hay una mejor manera de hacer lo que estoy tratando de hacer (manteniendo la separación entre la ventana docker:dind y la imagen de compilación $JAVA_IMAGE )?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!