Skip to content

Commit

Permalink
Merge pull request #19 from OmegaVVeapon/alpine-release
Browse files Browse the repository at this point in the history
Using python alpine version for the runtime container
  • Loading branch information
OmegaVVeapon authored Mar 19, 2021
2 parents 78078ee + 711c12b commit f1ffff5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ COPY Pipfile .
COPY Pipfile.lock .
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --ignore-pipfile --deploy

FROM base AS runtime
FROM python:3.8-alpine AS runtime

# Copy virtual env from python-deps stage
COPY --from=python-deps /.venv /.venv
Expand Down
8 changes: 3 additions & 5 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/bin/bash
#!/bin/sh
set -e

if [ "$1" = 'kopf-k8s-sidecar' ]; then

command=("python" "sidecar.py")

# command=("kopf" "run" "sidecar.py")
# [[ "$VERBOSE" = "true" ]] && command+=("--verbose")
# [[ "$DEBUG" = "true" ]] && command+=("--debug")
Expand All @@ -14,11 +12,11 @@ if [ "$1" = 'kopf-k8s-sidecar' ]; then

# Fix https://github.com/OmegaVVeapon/kopf-k8s-sidecar/issues/12 by setting the USER env var to prevent python from looking for a matching uid/gid in the password database.
# See https://github.com/python/cpython/blob/v3.6.0/Lib/getpass.py#L155-L170.
USER=$(id --user)
USER=$(id -u)
echo "Setting USER environment variable to ${USER}"
export USER=$USER

exec "${command[@]}"
exec python sidecar.py
fi

exec "$@"

0 comments on commit f1ffff5

Please sign in to comment.