common: Use gosu to replace chpst and add sudo abilities

From:

  https://github.com/tianon/gosu
This commit is contained in:
Matt McCormick
2017-04-22 20:52:31 -04:00
parent 6c77167ad6
commit 4c3612da2b
5 changed files with 43 additions and 14 deletions

View File

@@ -3,7 +3,7 @@ RUN REPO=http://cdn-fastly.deb.debian.org && \
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update --yes && apt-get install --yes \
RUN apt-get update --yes && apt-get install --no-install-recommends --yes \
automake \
autogen \
bash \
@@ -30,6 +30,18 @@ RUN apt-get update --yes && apt-get install --yes \
pax \
vim \
wget \
runit \
xz-utils && \
apt-get clean --yes
ENV GOSU_VERSION 1.10
RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true