Last active
August 11, 2021 20:59
-
-
Save seocam/39e4084262558590ff2f59463529d50a to your computer and use it in GitHub Desktop.
Dockerfile using distroless with gosu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian as build | |
WORKDIR /build/ | |
RUN set -eux; \ | |
apt-get update && \ | |
apt-get install -yq wget gpg && \ | |
wget https://github.com/tianon/gosu/releases/download/1.13/gosu-amd64 -O gosu && \ | |
wget https://github.com/tianon/gosu/releases/download/1.13/gosu-amd64.asc -O gosu.asc && \ | |
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && \ | |
gpg --batch --verify gosu.asc gosu && \ | |
chmod +x gosu | |
# --- | |
FROM gcr.io/distroless/python3-debian10 | |
COPY --from=build /build/gosu /usr/bin/ | |
ENTRYPOINT ["gosu", "888:888", "python", "-c", "import os; print(os.getuid(), os.getgid())"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment