Questions tagged [docker-multi-stage-build]
221 questions
2
votes
0 answers
how to use local dependency for docker images?
I have docker-compose with the following projects:
RabbitMQ management, producer and consumer,
producer and consumer (java springboot apps) share a maven dependency to common model api (3rd mini project containing POJOs used by producer and…

Nebra
- 106
- 3
2
votes
0 answers
Building multiple angular apps in a single docker image
I have a web application in Angular, made of multiple angular apps. For deploying these apps I need to build each app separately, copy the build contents to a path in a root folder and then copy the root folder (merged build) to a Nginx container.
I…

iamadnan
- 113
- 1
- 1
- 8
2
votes
1 answer
Docker Multistage Build Fails on copy from previous stage
I am working on a multistage docker build file in an attempt to add an additional war file to our base tomcat image. I am running this locally on a windows 10 workstation with Docker for Windows version 2.3.0.4 which uses docker engine version…

Paul Stoner
- 1,359
- 21
- 44
2
votes
0 answers
Is it possible to copy files to the host during a multistage docker build?
I have written the following Dockerfile to containerize a maven build:
FROM maven AS builder
WORKDIR /build
COPY . /build
RUN mvn -Dmaven.repo.local=.m2/repository clean test clover:instrument clover:clover clover:check findbugs:check package…

spierepf
- 2,774
- 2
- 30
- 52
2
votes
1 answer
Docker multi stage build: order
This is a request for comments and opinions. I am fairly new to Docker.
I want containers for production and development (maybe unit-test too) for a Python project. My search pointed toward the multi-stage Dockerfile (and multiple docker-compose to…

Groo the bug slayer
- 181
- 1
- 7
2
votes
1 answer
Why multi-stage docker image is bigger than single stage?
I've created a microsservice (https://github.com/staticdev/enelvo-microservice) that needs to clone a git repository to create a docker image, with a single stage Dockerfile the final image has 759MB:
FROM python:3.7.6-slim-stretch
# set the…

staticdev
- 2,950
- 8
- 42
- 66
2
votes
2 answers
Docker multi-stage build - exclude .git folder
I want to do a docker multi-stage build but rm/ignore the .git folder, to save space on the docker image.
FROM ubuntu as first
WORKDIR /app
RUN git clone
FROM golang as second
WORKDIR app
COPY --from=first /app .
is there is some --exclude…
user12211419
2
votes
1 answer
How to run Redis into multi-stage Docker image build?
I am doing a small Proof of Concept and want to run the Spring Boot application with Redis into the same container.
I found multi-stage build docs and official Redis image.
How should I connect them together? Even the concept seems to be for couple…

Dmytro Chasovskyi
- 3,209
- 4
- 40
- 82
2
votes
1 answer
How to use tagged intermediate image for final build?
I have created a multi-stage build.
Stage 1: use node:16.10-alpine to compile sources
Stage 2: use an alpine nginx image, copy build folder from first stage, move configuration, expose port, add entrypoint.
Here's the Dockerfile:
# Builder
FROM…

Filipp Sher
- 128
- 7
2
votes
1 answer
Docker multistage build vs. keeping artifacts in git
My target container is a build environment container, so my team would build an app in a uniform environment.
This app doesn't necessarily run as a container - it runs on physical machine. The container is solely for building.
The app depends on…

hudac
- 2,584
- 6
- 34
- 57
2
votes
1 answer
Docker multi-stage build for flask application
I want to dockerize flask application which has lots of dependencies. My goal is to reduce the size of the final docker image.
I tried multi-stage build but it is not reducing the size of final docker image.
Below is my Dockerfile
FROM…

Parth Shihora
- 75
- 2
- 8
2
votes
0 answers
Multi-stage python docker image using virtualenv
I am trying to reduce the size of my python docker image file using multi-stage. This is my Dockerfile.
Dockerfile
FROM ubuntu:18.04 AS builder
WORKDIR /usr/app
RUN apt-get update \
&& apt-get install -y python3-pip python3-dev python3-venv \
…

Justin
- 444
- 4
- 10
2
votes
1 answer
Docker multi-stage build not copying between stages
I'm trying to create a multi-stage build where the first stage does a yarn install for the theme and the second stage sets up the PHP environment for Drupal.
When I look at the output it looks like yarn install is being run but the COPY command near…

Neil Nand
- 549
- 6
- 25
2
votes
1 answer
Select angular.json configurations during docker multistage build
I'm building the angular6 app w/ a docker multistage build.
The default angular.json created by angular.cli contains a build section including a list of configurations.
I can select a specific configuration using the following command
ng build…

Crixo
- 3,060
- 1
- 24
- 32
2
votes
0 answers
With Docker, what files persist between stages?
There are few ways in which I can phrase my question. I find documentation lacking around how to use an artifact from a previous stage - specifically the example here.
My use case is I'm using a docker stage to makepkg an arch linux package, which…

haelix
- 4,245
- 4
- 34
- 56