apt-get
lists after installing anything DOK-DL300911ENV REPOSITORY ${REPOSITORY:-https://github.com/fossasia/open-event-server.git}
12
13# apt-get update
14RUN apt-get clean -y && apt-get update -y15# update some packages
16RUN apt-get install -y wget git ca-certificates curl && update-ca-certificates
17# install deps
5RUN apt-get install -y curl apt-transport-https
6RUN echo "deb https://packages.cloud.google.com/apt cloud-sdk-jessie main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
7RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
8RUN apt-get update -y && apt-get install -y google-cloud-sdk && apt-get autoremove -y 9RUN apt-get clean -y
10
11CMD gcloud info
1FROM debian:jessie-slim
2MAINTAINER Niranjan Rajendran <[email protected]>
3
4RUN apt-get clean -y && apt-get update -y 5RUN apt-get install -y curl apt-transport-https
6RUN echo "deb https://packages.cloud.google.com/apt cloud-sdk-jessie main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
7RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
Cleaning up the apt cache and removing /var/lib/apt/lists
helps keep the image size down. Since the RUN
statement starts with apt-get update
, the package cache will always be refreshed prior to apt-get install
.
You can read more about this here.
Note: Clean up must be performed in the same RUN step, otherwise it will not affect image size.
RUN apt-get update && apt-get install -y python
RUN apt-get update && apt-get install -y python \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
The official Debian and Ubuntu images are configured to automatically run apt clean
, so explicitly invoking apt clean
is not necessary there.