Skip to content

Commit 537c97f

Browse files
navarroaxeltcardonne
authored andcommitted
Reduce docker image size
1 parent 361e2e6 commit 537c97f

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

docker/Dockerfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ LABEL maintainer="[email protected]" \
3030
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
3131
apt-get install -y \
3232
curl \
33+
unzip \
3334
apt-transport-https \
3435
ca-certificates \
35-
curl \
3636
software-properties-common \
3737
sudo \
3838
supervisor \
@@ -42,25 +42,32 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
4242
zlib1g-dev \
4343
gettext \
4444
liblttng-ust0 \
45-
libcurl4-openssl-dev
45+
libcurl4-openssl-dev && \
46+
rm -rf /var/lib/apt/lists/* && \
47+
apt-get clean
4648

4749
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
4850
RUN chmod 644 /etc/supervisor/conf.d/supervisord.conf
4951

5052
# Install Docker CLI
51-
RUN curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
53+
RUN curl -fsSL https://get.docker.com -o- | sh && \
54+
rm -rf /var/lib/apt/lists/* && \
55+
apt-get clean
5256

5357
# Install Docker-Compose
54-
RUN curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
58+
RUN curl -L -o /usr/local/bin/docker-compose \
59+
"https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" && \
5560
chmod +x /usr/local/bin/docker-compose
5661

5762
RUN cd /tmp && \
58-
curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz && \
63+
curl -sL -o git.tgz \
64+
https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz && \
5965
tar zxf git.tgz && \
6066
cd git-${GIT_VERSION} && \
6167
./configure --prefix=/usr && \
62-
make && \
63-
make install
68+
make && \
69+
make install && \
70+
rm -rf /tmp/*
6471

6572
RUN mkdir -p /home/runner ${AGENT_TOOLSDIRECTORY}
6673

@@ -73,11 +80,9 @@ RUN GH_RUNNER_VERSION=${GH_RUNNER_VERSION:-$(curl --silent "https://api.github.c
7380
&& ./bin/installdependencies.sh \
7481
&& chown -R root: /home/runner \
7582
&& rm -rf /var/lib/apt/lists/* \
76-
&& rm -rf /tmp/* \
7783
&& apt-get clean
7884

7985
COPY entrypoint.sh /entrypoint.sh
8086
RUN chmod +x /entrypoint.sh
8187
ENTRYPOINT ["/entrypoint.sh"]
8288
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
83-

0 commit comments

Comments
 (0)