Questions tagged [docker-multi-stage-build]
221 questions
0
votes
2 answers
Join docker images in a single container
I have an application composed of a front end, a back end and a mongodb database, each of these dockerized in a container. When I build them with docker compose I have as many images as parts in my application (3).
Is there any way to build a…

MrSkineto
- 3
- 2
0
votes
1 answer
migrating CMake results in multi-stage Docker build
I have a CMake-based C++ project that I need to integrate into a CI/CD pipeline. The pipeline has two steps, one for building, the other for testing. Creating this environment in a Docker container works like a charm, but results in a 2GB container.…

Ravenwater
- 735
- 1
- 5
- 14
0
votes
2 answers
How to have two images in a Dockerfile without using Docker Compose?
How to have two images in the dockerfile and that are linked?
I don't want use docker compose, I want something like this
FROM node:latest
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm i
COPY .…

MrSkineto
- 3
- 2
0
votes
1 answer
Docker container with postgres and java
I would like a Docker Postgres container with Java.
Here my Dockerfile:
FROM postgres AS postgres
FROM openjdk
COPY --from=postgres . .
I don't get any errors. But when I execute java -version it says
command not found
I also tried this:
FROM…

Palmi
- 2,381
- 5
- 28
- 65
0
votes
1 answer
Multistage dockerfile - missing file
I have written a multistage build dockerfile trying to follow https://docs.docker.com/engine/userguide/eng-image/multistage-build/ :
FROM gcc:latest as compiler
WORKDIR /compiling/
ADD hello.c .
RUN gcc ./hello.c -o .hello
FROM scratch
WORKDIR…

user1608790
- 393
- 1
- 3
- 12
-1
votes
2 answers
Second docker image is overriding the first image
I am trying to create a dockerfile that will have image 1 and image 2 pulled from dockerhub. It seems that second image is overriding the changes of first image. How to handle this scenario.
FROM clamav/clamav:1.1
COPY clamd.conf /etc/clamav
EXPOSE…

DeadPool
- 40
- 8
-1
votes
1 answer
How do i run jest testcases without using npm command?
I have built docker test image using multistage and in the final image not recommended to install npm.
But using the final image i have to trigger jest testcases. Is there any way to trigger jest testcases without using npm/node commands?
Not…

gomathi
- 1
-1
votes
1 answer
Super newbie multi-stage docker image build question
I need to build custom image which contains both terraform and the gcloud CLI. Very new to docker so I'm struggling with this even though it seems very straight forward. I need to make a multi stage image from the following two…

Gary Turner
- 189
- 9
-1
votes
1 answer
Why does switching the base image in a multi-stage Docker build from distroless to alpine cause "exec user process caused: no such file or directory"?
I'm following the guide at https://docs.docker.com/language/golang/build-images/ to learn the best way to do a multistage Docker build for a Go application. I cloned the repo:
git clone https://github.com/olliefr/docker-gs-ping
And I ran the…

Matt Welke
- 1,441
- 1
- 15
- 40
-2
votes
1 answer
How to make multistage Docker build using Ansible?
I have a following task in Ansible playbook:
tasks:
- name: Start container
docker_container:
name: ubuntu
image: ubuntu:latest
image: python:latest
state: started
command: sleep infinity
But when I enter into…

MijatTomić
- 61
- 8