From 1562e9ab707f13e922ea52361fcdb663a14239fb Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Fri, 28 Apr 2017 19:55:19 +0800 Subject: Refactor Dockerfile 1. Use `apk -U --no-cache add` instead of `apk update` + `apk add` + manually cache clean up. 2. Separate package installation and user, group setup, the combination to reduce a docker image layer didn't bring benefits here, only makes Dockerfiles more complex. --- Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 2d47a18ba6..02e22e801d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,7 @@ MAINTAINER Thomas Boerger EXPOSE 22 3000 -RUN apk update && \ - apk add \ +RUN apk -U --no-cache add \ su-exec \ ca-certificates \ sqlite \ @@ -14,10 +13,8 @@ RUN apk update && \ s6 \ curl \ openssh \ - tzdata && \ - rm -rf \ - /var/cache/apk/* && \ - addgroup \ + tzdata +RUN addgroup \ -S -g 1000 \ git && \ adduser \ -- cgit v1.2.3