-
Notifications
You must be signed in to change notification settings - Fork 3
Dockerfile: Use podman user, not root
#588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5a4e9c0
dockerfile: Do not run as root
myakove 7442952
dockerfile: Do not run as root
myakove 0219bbf
Fix podman command
myakove 070c7ba
Use :noroot tag for now
myakove c86f0ad
Use :noroot tag for now
myakove 671812f
tox: dont use run_in_conatiner
myakove e286df3
tox: dont use run_in_conatiner
myakove 362e56f
tox: dont use run_in_conatiner
myakove e7dbef8
tox: dont use run_in_conatiner
myakove 62dba6e
tox: dont use run_in_conatiner
myakove 6518644
tox: dont use run_in_conatiner
myakove 808a0b1
testfile
myakove dc1c4a2
fix pypi release
myakove 6e6fc0f
fix pypi release
myakove d39bf0f
Merge branch 'main' of github.com:myk-org/github-webhook-server into …
myakove 5daaebd
Fix cherry-pick
myakove 1e5440a
Fix cherry-pick
myakove e8c9baa
dockerfile cleanup
myakove File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,74 +1,58 @@ | ||
| FROM quay.io/podman/stable:latest | ||
|
|
||
| EXPOSE 5000 | ||
|
|
||
| ENV USERNAME="podman" | ||
| ENV HOME_DIR="/home/$USERNAME" | ||
| ENV BIN_DIR="$HOME_DIR/.local/bin" | ||
| ENV UV_INSTALL_DIR="$HOME_DIR/.local" | ||
| ENV PATH="$PATH:$BIN_DIR" | ||
| ENV DATA_DIR="$HOME_DIR/data" | ||
| ENV APP_DIR="$HOME_DIR/github-webhook-server" | ||
|
|
||
| RUN dnf -y install dnf-plugins-core \ | ||
| && dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo \ | ||
| && dnf -y update \ | ||
| && dnf -y install python3.8 \ | ||
| python3.9 \ | ||
| python3.10 \ | ||
| python3.11 \ | ||
| python3.12 \ | ||
| python3-pip \ | ||
| && dnf -y install \ | ||
| git \ | ||
| hub \ | ||
| unzip \ | ||
| libcurl-devel \ | ||
| gcc \ | ||
| python3-devel \ | ||
| libffi-devel \ | ||
| docker-ce \ | ||
| docker-ce-cli \ | ||
| containerd.io \ | ||
| docker-buildx-plugin \ | ||
| docker-compose-plugin \ | ||
| && dnf clean all \ | ||
| && rm -rf /var/cache /var/log/dnf* /var/log/yum.* | ||
|
|
||
| ENV USER_BIN_DIR="/root/.local/bin" | ||
| ENV UV_INSTALL_DIR="/root/.local" | ||
| ENV PATH="$PATH:$USER_BIN_DIR" | ||
|
|
||
| ENV DATA_DIR=/webhook_server | ||
| ENV APP_DIR=/github-webhook-server | ||
|
|
||
| RUN mkdir -p $USER_BIN_DIR \ | ||
| RUN mkdir -p $BIN_DIR \ | ||
| && mkdir -p $APP_DIR \ | ||
| && mkdir -p $DATA_DIR \ | ||
| && mkdir -p $DATA_DIR/logs \ | ||
| && mkdir -p /tmp/containers | ||
|
|
||
| COPY entrypoint.sh pyproject.toml uv.lock README.md $APP_DIR/ | ||
| COPY webhook_server_container $APP_DIR/webhook_server_container/ | ||
|
|
||
| RUN usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USERNAME \ | ||
| && chown -R $USERNAME:$USERNAME $HOME_DIR | ||
|
|
||
| USER $USERNAME | ||
| WORKDIR $HOME_DIR | ||
|
|
||
| # Download the latest uv installer | ||
| RUN curl -sSL https://astral.sh/uv/install.sh -o /tmp/uv-installer.sh \ | ||
| && sh /tmp/uv-installer.sh \ | ||
| && rm /tmp/uv-installer.sh | ||
|
|
||
| RUN set -x \ | ||
| && curl https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/rosa-linux.tar.gz --output /tmp/rosa-linux.tar.gz \ | ||
| && tar xvf /tmp/rosa-linux.tar.gz --no-same-owner \ | ||
| && mv rosa $USER_BIN_DIR/rosa \ | ||
| && chmod +x $USER_BIN_DIR/rosa \ | ||
| && rm -rf /tmp/rosa-linux.tar.gz | ||
|
|
||
| RUN ln -s /usr/bin/python3 /usr/bin/python | ||
|
|
||
| RUN python -m pip install --no-cache-dir pip --upgrade \ | ||
| && python -m pip install --no-cache-dir poetry tox twine pre-commit | ||
|
|
||
| RUN python3.8 -m ensurepip \ | ||
| && python3.9 -m ensurepip \ | ||
| && python3.10 -m ensurepip \ | ||
| && python3.11 -m ensurepip \ | ||
| && python3.12 -m ensurepip \ | ||
| && python3.8 -m pip install tox \ | ||
| && python3.9 -m pip install tox \ | ||
| && python3.10 -m pip install tox \ | ||
| && python3.11 -m pip install tox \ | ||
| && python3.12 -m pip install tox | ||
|
|
||
| COPY entrypoint.sh pyproject.toml uv.lock README.md $APP_DIR/ | ||
| COPY webhook_server_container $APP_DIR/webhook_server_container/ | ||
| && curl https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/rosa-linux.tar.gz --output $BIN_DIR/rosa-linux.tar.gz \ | ||
| && tar xvf $BIN_DIR/rosa-linux.tar.gz \ | ||
| && mv rosa $BIN_DIR/rosa \ | ||
| && chmod +x $BIN_DIR/rosa \ | ||
| && rm -rf $BIN_DIR/rosa-linux.tar.gz | ||
|
|
||
| WORKDIR $APP_DIR | ||
|
|
||
| RUN uv sync | ||
|
|
||
| HEALTHCHECK CMD curl --fail http://127.0.0.1:5000/webhook_server/healthcheck || exit 1 | ||
|
|
||
| ENTRYPOINT ["./entrypoint.sh"] |
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.