Get the Dockerfile from the Docker imagedocker history --format {{.CreatedBy}} --no-trunc=true $DockerImage |sed “s//bin/sh\ -c\ #(nop)\ //g”|sed “s//bin/sh\ -c/RUN/g” | tac Note: This docker file does not map directories or ports and does not execute the docker startup script or server service. Docker multiple port mappingDocker multiple ports docker run -it -d --name container-name -p p1:p1 -p p2:p2 new-image-name -ip xxxxx —restart=always Method 1: Adding ports at runtime /var/lib/docker/containers/{container_id}/hostconfig.json Method 2: docker commit containerid now/live Run the image and add the port: docker run -d -p 8000:80 now/live /bin/bash Get the container IP: docker inspect container_name | grep IPAddressiptable forwarding portiptables -t nat -A DOCKER -p tcp --dport 8001 -j DNAT --to-destination 172.17.0.19:8000 Note: Mac may not be able to enter the screen Passing files to Dockersudo docker save -o /home/ubuntu_14804.tar 93123213127ccc This is the end of this article about how to add ports to docker and get dockerfile. For more information about how to add ports to docker and get dockerfile, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Advantages and disadvantages of conditional comments in IE
>>: mysql5.7 remote access settings
Table of contents 1. Introduction 2. Use 1. Diffe...
In this system, the # sign represents the root us...
The first one: Using the CSS position property &l...
In the world of web development, frameworks are ve...
I encountered a problem today: Can I use the as a...
react.js framework Redux https://github.com/react...
Table of contents MySQL slave library Seconds_Beh...
1. Introduction Containers use a sandbox mechanis...
I just bought an Alibaba Cloud host and couldn’t ...
1. Review Vue responsive usage Vue responsivenes...
Preface I recently learned Linux, and then change...
Possible solutions 1. Math.random generates rando...
Generally, lists have selection functions, and si...
In MySQL, we often use order by for sorting and l...
Today I will use the server nginx, and I also nee...