cbfs
November 26, 2020, 6:58am
1
I am trying to upgrade a docker container from v4.5.13 to invoiceninja:latest. When I upgrade the container to the latest version, I cannot start the container anymore.
It’s failing due to this chown operation in entrypoint.sh
:
# Set permission for web server to create/update files
chown -R invoiceninja:www-data /var/www/app/storage /var/www/app/public /var/www/app/bootstrap
I just get a bunch of Operation Not Permitted errors, ex:
ninja[14583]: chown: /var/www/app/storage/app: Operation not permitted
I get the same Operation Not Permitted errors even when running the container with root permissions.
Is there any way to fix this?
hillel
November 26, 2020, 8:26am
2
Hi,
Sorry, I’m not sure. I don’t have too much experience with Docker
Maybe this will help?
opened 07:10PM - 02 Jun 16 UTC
closed 09:51PM - 02 May 18 UTC
question
I am using Vagrant's docker provisioner to install a docker host on a developmen… t VM and then run the redis:3.2 image in a container.
When I was using vagrant 1.7.2 (which installed docker 1.9.1) and VirtualBox 4.3.x the following vagrantfile snippet worked:
``` ruby
# according to the docker docs, this command is idempotent as long as the same driver is used
dbs.vm.provision 'shell', inline: "docker volume create --driver local --name datastore"
dbs.vm.provision "docker" do |docker|
# run the redis container (Vagrant daemonizes and restarts by default, no need to add flags here)
# use the datastore volume for storage and run as linux user id 1000 (works around filesystem permissions issues)
docker.run "redis",
image: "redis:3.2",
args: "-v 'datastore:/data' -p '6379:6379' -u 1000",
cmd: "redis-server --appendonly yes"
end
```
Now that I have updated to VirtualBox 5.0.20, Vagrant 1.8.1 (which installs docker 1.11.2), I get the following error:
```
==> dbs: datastore
==> dbs: Running provisioner: docker...
==> dbs: Starting Docker containers...
==> dbs: -- Container: redis
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
rm -f /var/lib/vagrant/cids/b840fc02d524045429941cc15f59e41cb7be6c52
docker run --cidfile=/var/lib/vagrant/cids/b840fc02d524045429941cc15f59e41cb7be6c52 -d --name redis --restart=always -v 'datastore:/data' -p '6379:6379' -u 1000 redis:3.2 redis-server --appendonly yes
Stdout from the command:
Stderr from the command:
Unable to find image 'redis:3.2' locally
3.2: Pulling from library/redis
... snipped the boring layer downloading stuff ...
78fc0c16bb0c: Pull complete
Digest: sha256:69ce82b2ed29f117c2dadf537ef7bed741e851705239a20fe9616a97eb48281d
Status: Downloaded newer image for redis:3.2
docker: Error response from daemon: chown /var/lib/docker/volumes/datastore/_data: operation not permitted.
See 'docker run --help'.
```
I note that the `docker-entrypoint.sh` for 3.2 is what runs the `chown` command. Can you think of any reason why the container no longer has permissions to `chown /var/lib/docker/volumes/datastore/_data` just because I updated to a newer Vagrant/Docker combination?
EDIT: I have also tried to run these containers with --privileged=true but I get the same error.