wirfen
(Wirfen)
1
Hi people, im trying to rebuild an old container that was working but I have no permissions for run the app:
Here is my dockerfile:
FROM python:latest
RUN useradd -ms /bin/bash wirfen
WORKDIR /home/wirfen
ENV PATH=“/home/wirfen/.local/bin:${PATH}”
#ENV TZ=“Europe/Madrid”
COPY --chown=wirfen:wirfen files ./files
COPY --chown=wirfen:wirfen funciones ./funciones
COPY --chown=wirfen:wirfen static ./static
COPY --chown=wirfen:wirfen templates ./templates
COPY --chown=wirfen:wirfen app.py app.py
COPY --chown=wirfen:wirfen requirements.txt requirements.txt
USER wirfen
#RUN pip install --user -r requirements.txt
#CMD [“python”, “app.py”]
CMD [“sleep”, “5000”]
And my docker compose:
version: “3”
services:
herramientas:
build:
context: .
dockerfile: Dockerfile
container_name: herramientas
image: herramientas
restart: unless-stopped
networks:
- herramientas
ports:
- “12346:12346”
volumes:
- ‘/certificados:/certificados’
networks:
herramientas:
driver: bridge
wirfen
(Wirfen)
2

Inside the container
With root user works perfectly.
terpz
(Martin Terp)
3
Hi,
If you
docker exec -ti --user root CONTAINER-NAME bash
and do the ls -l /home/wirfen, what permissions does the files have?
terpz
(Martin Terp)
5
Hi again,
Are you sure that you’re rebuilding the image after you made some changes? (docker compose build)
If i try to create the image with the same Dockerfile (though with only 1 file)
root@server:/tmp# docker run -ti --rm test:latest bash
wirfen@ee97e4c946d6:~$ ls -l
-rw-r--r-- 1 wirfen wirfen 0 Aug 7 12:13 file
wirfen@ee97e4c946d6:~$
wirfen
(Wirfen)
6
I launch with this:
docker-compose -f docker-compose.yaml up -d --build
–build for add changes in *.py files. Thats is my mistake?
Edit: Ommiting --build same effect
wirfen
(Wirfen)
7
I solved it.
I download again the docker-compose binary file, build it again and works perfectly now.
Maybe a bug?
meyay
(Metin Y.)
8
Standalone docker-compose
(v1) is superseded by the docker compose
cli-plugin (v2).