I have one docker container, that container is running in weblogic11 so that Weblogic is running by default in Production-mode, so I want to change that production-mode to Development-mode, for that I need to edit file config.xml inside the container, how we can edit that file from outside the container?
You can do this by mounting your volumes. E.g
services:
web:
image: your_image:tag
volumes:
- app_config:/locaiton_of_config_folder
volumes:
app_config:
This will create docker volumes and it will be mounted at /var/lib/docker/volumes/volume_name/_data and you can edit the files. Be sure to use sudo because the files are created by root user inside docker.
You can check the list of volumes by docker volume ls.
There is one quite simple workaround to doing that.
You want to copy out the file from the running container:
docker cp <container_id>:/path/to/file .
You could edit the file with whatever you want, and you just should copy it back:
docker cp file <container_id>:/path/to/file
Optional: if you want your file to be persisted, you just need to commit the changes:
docker commit <container_id> <new_image_name>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With