Skip to content
This repository was archived by the owner on Oct 4, 2024. It is now read-only.

Commit a631449

Browse files
authored
Merge pull request #421 from gilesknap/dev
Fix non root user container usage
2 parents 6993bad + ddeb21d commit a631449

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.devcontainer/Dockerfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ RUN apt-get update && \
2222
WORKDIR /workspace
2323
COPY . .
2424

25-
# install runtime from DIST if there is one
26-
2725
# install runtime from DIST if there is one
2826
RUN mkdir -vp /root/.local && \
2927
if [ -d dist ] ; then \
@@ -40,7 +38,8 @@ RUN mkdir -vp /root/.config /config \
4038
&& mkdir -vp /storage
4139

4240
# make the installed version of gphotos-sync available to non root users
43-
RUN chmod -R a+rx /root/.local
41+
RUN chmod -R a+rx /root
42+
ENV HOME=/root
4443

4544
VOLUME /config /storage
4645

.devcontainer/local_build.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
# locally build a runtime container for testing
22

3+
THIS_DIR=$(dirname $(realpath $0))
4+
PYTHON_ROOT=$(realpath $THIS_DIR/..)
5+
36
# first make sure a wheel is built
47
(
5-
cd ..
8+
cd ${PYTHON_ROOT}
69
pip install build
710
rm -r dist
811
python -m build --wheel
912
)
1013

1114
# make the container name the same as the root folder name of this clone
12-
container_name=$(cd ..; basename $(realpath .))
15+
container_name=$(cd ${PYTHON_ROOT} ; basename $(realpath .))
1316
echo building $container_name ...
1417

1518
# run the build with required build-args for a runtime build
19+
cd ${THIS_DIR}
1620
ln -s ../dist .
1721
docker build --build-arg BASE=python:3.10-slim -t $container_name .. --file ./Dockerfile
1822
unlink dist

0 commit comments

Comments
 (0)