docker: move apt-get to top of Dockerfile

this should allow for more build layer caching

Signed-off-by: Derek Perkins <derek@derekperkins.com>
This commit is contained in:
Derek Perkins 2018-11-01 17:34:43 -06:00
Родитель 0dda09038e
Коммит 7c1e60c3a7
6 изменённых файлов: 53 добавлений и 53 удалений

Просмотреть файл

@ -2,6 +2,14 @@ FROM vitess/base AS base
FROM debian:stretch-slim
# TODO: remove when https://github.com/vitessio/vitess/issues/3553 is fixed
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install mysql-client -qq --no-install-recommends && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTROOT /vt
ENV VTDATAROOT /vtdataroot
@ -50,11 +58,3 @@ COPY --from=base $VTTOP/config/mycnf/rbr.cnf /vt/config/mycnf/
# add vitess user and add permissions
RUN groupadd -r --gid 999 vitess && useradd -r -g vitess --uid 999 vitess && \
chown -R vitess:vitess /vt;
# TODO: remove when https://github.com/vitessio/vitess/issues/3553 is fixed
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install mysql-client -qq --no-install-recommends && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Просмотреть файл

@ -2,6 +2,13 @@ FROM vitess/k8s AS k8s
FROM debian:stretch-slim
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install busybox -qq --no-install-recommends && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTROOT /vt
ENV VTDATAROOT /vtdataroot
@ -18,10 +25,3 @@ COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificate
# copy vitess config
COPY --from=k8s /vt/config /vt/config
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install busybox -qq --no-install-recommends && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Просмотреть файл

@ -2,22 +2,22 @@ FROM vitess/k8s AS k8s
FROM debian:stretch-slim
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install wget -qq --no-install-recommends && \
wget https://github.com/github/orchestrator/releases/download/v3.0.13/orchestrator_3.0.13_amd64.deb && \
dpkg -i orchestrator_3.0.13_amd64.deb && \
rm orchestrator_3.0.13_amd64.deb && \
apt-get purge wget -qq && \
apt-get autoremove -qq && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy certs to allow https calls
COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
# Copy vtctlclient to be used to notify
COPY --from=k8s /vt/bin/vtctlclient /usr/bin/
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install wget -qq --no-install-recommends && \
wget https://github.com/github/orchestrator/releases/download/v3.0.13/orchestrator_3.0.13_amd64.deb && \
dpkg -i orchestrator_3.0.13_amd64.deb && \
rm orchestrator_3.0.13_amd64.deb && \
apt-get purge wget -qq && \
apt-get autoremove -qq && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/local/orchestrator
CMD ["./orchestrator", "--config=/conf/orchestrator.conf.json", "http"]

Просмотреть файл

@ -2,17 +2,17 @@ FROM vitess/k8s AS k8s
FROM debian:stretch-slim
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install -y procps && \
apt-get install wget -qq --no-install-recommends && \
wget https://www.percona.com/redir/downloads/pmm-client/1.15.0/binary/debian/stretch/x86_64/pmm-client_1.15.0-1.stretch_amd64.deb && \
dpkg -i pmm-client_1.15.0-1.stretch_amd64.deb && \
rm pmm-client_1.15.0-1.stretch_amd64.deb && \
apt-get purge wget -qq && \
apt-get autoremove -qq && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy CA certs for https calls
COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install -y procps && \
apt-get install wget -qq --no-install-recommends && \
wget https://www.percona.com/redir/downloads/pmm-client/1.15.0/binary/debian/stretch/x86_64/pmm-client_1.15.0-1.stretch_amd64.deb && \
dpkg -i pmm-client_1.15.0-1.stretch_amd64.deb && \
rm pmm-client_1.15.0-1.stretch_amd64.deb && \
apt-get purge wget -qq && \
apt-get autoremove -qq && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Просмотреть файл

@ -2,13 +2,13 @@ FROM vitess/k8s AS k8s
FROM debian:stretch-slim
COPY --from=k8s /vt/bin/vtctlclient /usr/bin/
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install jq -qq --no-install-recommends && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
apt-get upgrade -qq && \
apt-get install jq -qq --no-install-recommends && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --from=k8s /vt/bin/vtctlclient /usr/bin/
CMD ["/usr/bin/vtctlclient"]

Просмотреть файл

@ -2,6 +2,14 @@ FROM vitess/k8s AS k8s
FROM debian:stretch-slim
# TODO: remove when https://github.com/vitessio/vitess/issues/3553 is fixed
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install mysql-client jq -qq --no-install-recommends && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTROOT /vt
ENV VTDATAROOT /vtdataroot
@ -15,11 +23,3 @@ COPY --from=k8s /vt/bin/vtctlclient /vt/bin/
# Copy certs to allow https calls
COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
# TODO: remove when https://github.com/vitessio/vitess/issues/3553 is fixed
RUN apt-get update && \
apt-get upgrade -qq && \
apt-get install mysql-client jq -qq --no-install-recommends && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*