Open gdesmott opened 4 years ago
Looks like the resume
directory created in the image is still owned by root
instead of app
:
drwxrwxr-x. 7 root root 4096 Jan 31 11:26 resume
So yeah the problem is with the custom user. If I remove it all then it works fine.
--- a/.docker/resume.dockerfile
+++ b/.docker/resume.dockerfile
@@ -1,11 +1,5 @@
FROM ubuntu
-# prepare a user which runs everything locally! - required in child images!
-RUN useradd --user-group --create-home --shell /bin/false app
-
-ENV HOME=/home/app
-WORKDIR $HOME
-
RUN apt-get update && \
apt-get install -y \
build-essential \
@@ -23,11 +17,9 @@ ENV APP_NAME=resume
# before switching to user we need to set permission properly
# copy all files, except the ignored files from .dockerignore
-COPY . $HOME/$APP_NAME/
-COPY ./Makefile $HOME/$APP_NAME/
-RUN chown -R app:app $HOME/*
+COPY . $APP_NAME/
+COPY ./Makefile $APP_NAME/
-USER app
-WORKDIR $HOME/$APP_NAME
+WORKDIR $APP_NAME
RUN make clean
Since it works in docker
but not podman
, it sounds like a bug in libpod
. Is there an open issue with them? I don't believe it should be mounting all of the current directory as root
.
I've made some changes to the dockerfile and docker-compose.yml, and tested locally with podman-compose. It should all work now.
Trying to build using Docker on Fedora 31. I have to use
podman
as Docker is no longer supported on Fedora. It's supposed to have the exact same cli but for some reason that doesn't seem to work.Looks like the image is properly generated but it doesn't find the
Makefile
.Here are the full logs: