DockrFeaturedLinuxRaspberry
0

How to change run command for docker container

Use the docker stop my-container command to stop the container you want to edit, then continue to make your changes.

Container config files have the following path on your host:

/var/lib/docker/containers/<container id>/config.v2.json

You need to know the container’s full ID, not the truncated version shown by docker ps. You can use the docker inspect command to get this:

docker inspect <short id or name> | jq | grep Id
docker container stop <short id or name>
vi /var/lib/docker/containers/a90d2d030239117d06ffd1841cde4265612bd0f62a41a940bcebed0c9480dc1b/config.v2.json

Update what you need

systemctl restart docker
docker start <short id or name>

Leave a Reply

Your email address will not be published. Required fields are marked *