Docker Container Create
|
Article Topic Docker Container Create with example?
Below is the example to create a Docker Container with below syntax and command:-
Table of Contents
(1)Adding -add-host options
(2)Add -a, -attach options
(3)Add -e, -env
(4)Add -m, -memory
|
(1)Adding -add-host options
|
This below command creates the container by just mapping the custom hostname to the Host IP. And to do that we use the below command to create:-
docker container create --add-host myhost:192.168.1.1 myImage
|
(2)Add -a, -attach options
|
Here when we use -a or -attach option with the docker container. Here we will create facilities with creating the container with attachments to its STDIN, STDOUT or the STDERR:-
docker container create -a my_container
|
(3)Add -e, -env
|
Here when we use -e or -env with docker-container by creating facilitates setting the environment variables for the container, which is necessary when using database images.
docker container create -e MYSQL_ROOT_PASSWORD=password myImage
|
|
(4)Add -m, -memory
|
When we use -m or -memory with docker-container, we create the container with a memory limit of 512 MB based on the docker image. SO to do that we use the below command:-
docker container create -m 512m myImage
|
|
Other Important QuestionsArticle Topic Create a Docker Container Image with each step guideArticle Topic Proc and Cons of Docker for self hostingArticle Topic Docker Container Create with example?
|