Permission denied error on installing traccer server in docker image

Xubyra year ago
docker run --rm --entrypoint cat traccar/traccar:latest /opt/traccar/conf/traccar.xml > /opt/traccar/traccar.xml

on ubuntu 22.04

error:

bash: /opt/traccar/traccar.xml: Permission denied
Anton Tananaeva year ago

Have you checked the file and permissions?

Xubyra year ago

I again created a fresh new EC2 instances and run the following command to install docker.
Permission problem resolved after running sudo su. So below are all the command I run

1. sudo su
2. sudo apt-get update
3. sudo apt-get install docker.io -y
4. sudo systemctl start docker
5. sudo docker run hello-world
6. sudo systemctl enable docker
7. docker --version
8. sudo usermod -a -G docker $(whoami)

After installing docker, I run docker image command of traccer.

1. sudo mkdir -p /opt/traccar/logs
2. sudo docker run --rm --entrypoint cat traccar/traccar:latest /opt/traccar/conf/traccar.xml > /opt/traccar/traccar.xml
3. sudo docker run --name traccar --hostname traccar --detach --restart unless-stopped --publish 80:8082 --publish 5000-5150:5000-5150 --publish 5000-5150:5000-5150/udp --volume /opt/traccar/logs:/opt/traccar/logs:rw --volume /opt/traccar/traccar.xml:/opt/traccar/conf/traccar.xml:ro traccar/traccar:latest

After running last command 3 nothing happened only long a string id generated

..................................
I also attached link of screenshot of terminal, I placed the screenshot in sequence of command from 1 to 5

Screenshort 1: https://ibb.co/CKFd4L1
Screenshort 2: https://ibb.co/fDrgSXv
Screenshort 3: https://ibb.co/tB3yzbt
Screenshort 4: https://ibb.co/frQBV66
Screenshort 5: https://ibb.co/Snn1HkH