-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from gizmoguy/python-3.9-alpine-base
Change base image from faucet/base to python:3.9-alpine3.15.
- Loading branch information
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
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"] |
This file contains 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
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 "$@" |