Skip to content

Commit

Permalink
Fix .cache folder permission in docker (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
YifuTao authored Oct 2, 2024
2 parents 3bda9d1 + df07d77 commit e8f7746
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .docker/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
UID=1000
GID=1000
UNAME=docker_dev
HOST_SPIRES_DATA_DIR=~/data/oxford_spires_dataset
HOME_DIR=/home
SPIRES_DIR=${HOME_DIR}/oxford_spires_dataset
SPIRES_DIR=${HOME_DIR}/${UNAME}/oxford_spires_dataset
SPIRES_DATA_DIR=${SPIRES_DIR}/data
5 changes: 3 additions & 2 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ENV UNAME=docker_dev
RUN addgroup --gid $GID $UNAME
RUN adduser --disabled-password --gecos '' --uid $UID --gid $GID $UNAME

ARG SPIRES_DIR=/home/oxford_spires_dataset
ARG SPIRES_DIR=/home/${UNAME}/oxford_spires_dataset
WORKDIR ${SPIRES_DIR}

COPY ./requirements.txt ${SPIRES_DIR}/requirements.txt
Expand All @@ -147,10 +147,11 @@ COPY ./spires_cpp ${SPIRES_DIR}/spires_cpp/
COPY ./pyproject.toml ${SPIRES_DIR}/pyproject.toml
RUN cd ${SPIRES_DIR}/spires_cpp && pip install -e .
RUN pip install -e .
RUN mkdir /home/${UNAME}/.cache

# Make the outputs of the container match the host

RUN chown -R ${UID}:${GID} ${SPIRES_DIR}
RUN chown -R ${UID}:${GID} /home/${UNAME}
USER ${UNAME}
RUN echo "PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@docker-\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '" >> ~/.bashrc
RUN echo "alias recon_benchmark=\"python ${SPIRES_DIR}/scripts/reconstruction_benchmark/main.py\"" >> ~/.bashrc
Expand Down

0 comments on commit e8f7746

Please sign in to comment.