badeoel
October 12, 2016, 8:39am
#1
I tried to start sudo -u www-data php occ files:scan inside the official Docker Container. Unfortunately sudo is not installed and when using su www-data php occ files:scan I get a message, that the account is currently not available.
Any other Idea, starting the files:scan?
Hi,
two things you can do:
Install sudo in the docker container (ask the container provider to install it by default?)
Enable the www-data account (hint: /etc/passwd and /usr/sbin/nologin)
where Nr. 1 should be preferred.
badeoel
October 12, 2016, 12:15pm
#3
RealRancor:
/usr/sbin/nologin
Thank you, I tried both. Unfortunately the owncloud-docker container is so limited, that I can't install sudo nor can edit the mentioned files. But I found another solution.
badeoel
October 12, 2016, 12:19pm
#4
I fortunately can answer my question myself: On your docker-host, you can run the docker command
docker exec -it -u www-data bash
With this, you are logged in as www-data and directly can start the file-scan:
php occ files:scan --all
2 Likes
mac
December 9, 2020, 7:26pm
#5
For those who read this later, you need to know the name of the image that the docker is running. Get this via:
% docker container ls
CONTAINER ID .... NAMES
08bd316d2cb1 .... owncloud_owncloud_1
b1a793332f7f .... owncloud_redis_1
Then run
docker exec -it -u www-data owncloud_owncloud_1 bash
1 Like
Even better would be to run (if you’re using the official docker image):
docker exec -it -u www-data owncloud_owncloud_1 entrypoint bash
To load the ownCloud settings set in the docker environment into the interactive bash you’re opening.
1 Like
lukaz
June 12, 2021, 8:39pm
#7
Thank you badeoel this is a very cool hint !!!
1 Like