This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 171
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 #421 from gilesknap/dev
Fix non root user container usage
- Loading branch information
Showing
2 changed files
with
8 additions
and
5 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
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,18 +1,22 @@ | ||
# locally build a runtime container for testing | ||
|
||
THIS_DIR=$(dirname $(realpath $0)) | ||
PYTHON_ROOT=$(realpath $THIS_DIR/..) | ||
|
||
# first make sure a wheel is built | ||
( | ||
cd .. | ||
cd ${PYTHON_ROOT} | ||
pip install build | ||
rm -r dist | ||
python -m build --wheel | ||
) | ||
|
||
# make the container name the same as the root folder name of this clone | ||
container_name=$(cd ..; basename $(realpath .)) | ||
container_name=$(cd ${PYTHON_ROOT} ; basename $(realpath .)) | ||
echo building $container_name ... | ||
|
||
# run the build with required build-args for a runtime build | ||
cd ${THIS_DIR} | ||
ln -s ../dist . | ||
docker build --build-arg BASE=python:3.10-slim -t $container_name .. --file ./Dockerfile | ||
unlink dist |