Skip to content
Snippets Groups Projects
Commit e69ead23 authored by nimrod's avatar nimrod
Browse files

Just a single latest image based on Alpine.

parent 3029a026
Branches
No related tags found
No related merge requests found
ARG GOSU_VERSION=1.12
ARG ALPINE_VERSION=3.12
FROM alpine:$ALPINE_VERSION as scratch
ARG GOSU_VERSION
ENV GOSU_VERSION=$GOSU_VERSION
RUN set -eux; \
\
apk add --no-cache --virtual .gosu-deps \
ca-certificates \
dpkg \
gnupg \
; \
\
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"; \
\
# verify the signature
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; \
command -v gpgconf && gpgconf --kill all || :; \
\
chmod +x /usr/local/bin/gosu; \
# verify that the binary works
gosu --version; \
gosu nobody true;
FROM alpine:$ALPINE_VERSION
ARG GOSU_VERSION
ENV GOSU_VERSION $GOSU_VERSION
COPY --from=scratch /usr/local/bin/gosu /usr/local/bin/
# Dockerized gosu # Dockerized gosu
> Docker images with gosu installed. > Alpine Docker image with gosu installed.
## Usage
The image is based on the latest Alpine image with just `gosu` installed. If you
wish to use a different image as a base then you can just copy the binary from
this image so:
```
FROM adarnimrod/gosu as gosu
FROM alpine:latest
COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/
```
## License ## License
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment