Skip to content

Commit

Permalink
Merge pull request #11 from gizmoguy/python-3.9-alpine-base
Browse files Browse the repository at this point in the history
Change base image from faucet/base to python:3.9-alpine3.15.
  • Loading branch information
gizmoguy authored Mar 30, 2022
2 parents a92c4e3 + a11b35f commit b7a8099
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
## Image name: faucet/python3

FROM faucet/base:7.0.0
FROM python:3.9-alpine3.15

RUN apk add --no-cache python3 py-pip && \
RUN apk add --no-cache bash su-exec && \
if [ ! -e /usr/bin/pip ]; then ln -s /usr/bin/pip3 /usr/bin/pip; fi && \
if [ ! -e /usr/bin/python ]; then ln -s /usr/bin/python3 /usr/bin/python; fi

COPY entrypoint.sh /usr/local/bin/entrypoint.sh

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
15 changes: 15 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Add local user
# Either use the LOCAL_USER_ID if passed in at runtime or
# fallback to 0 to maintain backwards compatibility

USER_ID=${LOCAL_USER_ID:-0}
GROUP_ID=${LOCAL_GROUP_ID:-0}

echo "Starting with UID=$USER_ID GID=$GROUP_ID"
export HOME="/home/faucet"
addgroup -g "${GROUP_ID}" faucet >/dev/null 2>&1 || true
adduser -u "${USER_ID}" -G faucet -g "" -h "${HOME}" -D faucet >/dev/null 2>&1 || true

exec /sbin/su-exec faucet "$@"

0 comments on commit b7a8099

Please sign in to comment.