From 92be0f58e227fcda727152b4f618b2746625295c Mon Sep 17 00:00:00 2001 From: ooxi Date: Wed, 11 Jan 2017 21:49:33 +0100 Subject: [PATCH] Avoid caching problems `apt-get update` and `apt-get install` have to be executed at once, otherwise the update will be cached separately from the install which might cause caching issues (trying to install a package not available any more because update information is too old). See [docker best practices](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/apt-get) --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e30a9db..8f799d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,7 @@ RUN chmod 0644 /etc/cron.d/hello-cron RUN touch /var/log/cron.log #Install Cron -RUN apt-get update -RUN apt-get -y install cron - +RUN apt-get -y update && apt-get -y install cron # Run the command on container startup CMD cron && tail -f /var/log/cron.log