diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-04-07 03:28:27 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-04-07 03:28:27 +0300 |
commit | 7bd7b35c2567bd8f664d95d2b2f4bf6235610029 (patch) | |
tree | 17e34d982b9e196993ff64478cd226ad10ac632d | |
parent | Makefile: best practices (diff) | |
download | jekyll-docker-7bd7b35c2567bd8f664d95d2b2f4bf6235610029.tar.gz jekyll-docker-7bd7b35c2567bd8f664d95d2b2f4bf6235610029.zip |
Dockerfile: best practices
-rw-r--r-- | Dockerfile.base | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Dockerfile.base b/Dockerfile.base index f56a9b3..4fe8add 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -2,17 +2,15 @@ FROM debian:buster-slim SHELL ["/bin/bash", "-c"] -ENV DEBIAN_FRONTEND=noninteractive - RUN apt update -yq && \ - apt install -yq --no-install-recommends \ + DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends \ build-essential \ ca-certificates gnupg wget \ sudo \ nano vim # Install gosu (better sudo, basically). -ENV GOSU_VERSION 1.12 +ARG GOSU_VERSION=1.12 RUN DPKG_ARCH="$( dpkg --print-architecture | awk -F- '{ print $NF }' )" && \ wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$DPKG_ARCH" && \ wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$DPKG_ARCH.asc" && \ @@ -20,12 +18,12 @@ RUN DPKG_ARCH="$( dpkg --print-architecture | awk -F- '{ print $NF }' )" && \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && \ gpgconf --kill all && \ - rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc && \ + rm -rf -- "$GNUPGHOME" /usr/local/bin/gosu.asc && \ chmod +x /usr/local/bin/gosu && \ gosu nobody true -ENV DEFAULT_UID=999 -ENV DEFAULT_GID="$DEFAULT_UID" +ARG DEFAULT_UID=999 +ARG DEFAULT_GID="$DEFAULT_UID" ARG JEKYLL_UID ARG JEKYLL_GID |