Skip to content

Commit b7a8099

Browse files
authored
Merge pull request #11 from gizmoguy/python-3.9-alpine-base
Change base image from faucet/base to python:3.9-alpine3.15.
2 parents a92c4e3 + a11b35f commit b7a8099

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
## Image name: faucet/python3
22

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

5-
RUN apk add --no-cache python3 py-pip && \
5+
RUN apk add --no-cache bash su-exec && \
66
if [ ! -e /usr/bin/pip ]; then ln -s /usr/bin/pip3 /usr/bin/pip; fi && \
77
if [ ! -e /usr/bin/python ]; then ln -s /usr/bin/python3 /usr/bin/python; fi
8+
9+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
10+
11+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

entrypoint.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Add local user
4+
# Either use the LOCAL_USER_ID if passed in at runtime or
5+
# fallback to 0 to maintain backwards compatibility
6+
7+
USER_ID=${LOCAL_USER_ID:-0}
8+
GROUP_ID=${LOCAL_GROUP_ID:-0}
9+
10+
echo "Starting with UID=$USER_ID GID=$GROUP_ID"
11+
export HOME="/home/faucet"
12+
addgroup -g "${GROUP_ID}" faucet >/dev/null 2>&1 || true
13+
adduser -u "${USER_ID}" -G faucet -g "" -h "${HOME}" -D faucet >/dev/null 2>&1 || true
14+
15+
exec /sbin/su-exec faucet "$@"

0 commit comments

Comments
 (0)