Joseph Peculiar
Posted on November 5, 2020
You have a running production container (a synced node) and you would want to either edit or bind new ports in this container, as opposed to spinning up a new container.
The following steps should aid you to achieve this.
1.Stop the running Container
docker stop <container-id>
2.Open Docker containers directory
/var/lib/docker/containers/
cd <container-id>
3.Edit hostconfig.json
Open hostconfig.json
with nano or vim
locate and edit PortBindings
with the new ports you want to edit, open or delete.
for instance
"PortBindings":{"18332/tcp":[{"HostIp":"","HostPort":"18332"}],"18334/tcp":[{"HostIp":"","HostPort":"18334"}]}
4.Restart Docker
systemctl restart docker
5.Start container
docker start <container-id>
💖 💪 🙅 🚩
Joseph Peculiar
Posted on November 5, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
dotnet Building a Linux Based Minimal and Efficient .NET 8 Application Docker Image
November 24, 2024