php - build image using Docker Multi-stage builds
Currently , i need to build a custom image that should contain jenkins and php 7.2 .
I have tried this shot :
FROM jenkins/jenkins:lts as jenkins
USER root
ARG TIMEZONE
# update
RUN apt update
# dependencies
RUN apt install -qqy \
tzdata \
wget \
curl \
...
# Timezone
RUN echo "Europe/Paris" > /etc/timezone
FROM php:7.2-apache
WORKDIR /var/jenkins
COPY --from=build-env /app/_site ./
RUN apt-get update && apt-get install -y \
openssl \
git \
unzip vim \
libfreetype6-dev \
...
The second FROM (FROM php:7.2-apache) crush the whole above . And it's normal as docker behavior .
Using theCopy
command likeCOPY --from=jenkins /app/site ./
still blurred since there is not idea what to copy-paste .
Is there any solution to resolve that issue ?