pull CentOS Pull Docker Mirror (default is pulled from the official mirror warehouse, if pull do not come down, we suggest that Baidu switch domestic mirror warehouse)
2.docker run-p 8082:80-v/mnt/hgfs/public/:/mnt/hgfs/public/--name mycentos-it CentOSTo generate a new container from a mirror,Where-P is the port mapping, the 8082 port of the host is mapped to 80
Today, I encountered a dockerfile to create a mirror, the mirror run after the container automatically end the problem.
Start command:
Docker run-d-P 8080:8080-v/usr/local/tomcat7.0/logs:/usr/local/tomcat7.0/logs--name tomcatweb tomcat:7.0
After running with Docker PS fou
Apache is a streaming framework that officially provides Docker mirroring, and also provides instructions based on the Docker-compose runDocker-compose fileversion: "2.1"services: jobmanager: image: flink expose: - "6123" ports: - "8081:8081" command: jobmanager environment: - JOB_MANAGER_RPC_ADDRESS=jobmanager taskmanager: imag
-size: Set the size of the/DEV/SHM, the default value is 64M;
--ulimit: Ulimit configuration.
--tag,-t: the name and label of the image, usually Name:tag or name format; You can set multiple tags for one mirror in a single build.
--network: default. Setting the network mode of the Run command during build
InstanceCreate the image using the Dockerfile of the current directory, labeled RUNOOB/UBUNTU:V1
中运行hello world!Docker run learn/tutorial apt-get install-y ping# Installing a new program in a containerSave ImageFirst use the Docker ps-l command to obtain the ID of the container after the ping command is installed. Then save this image as learn/ping.Tips:1.
Description: Starting a specified network through a container overrides the default bridge network Docker0.# Create three containers Container1,container2,container3dockerrun-itd --name=container1 busyboxdocker run-itd --name=container2 busybox# Create a network Mynetdocker Network create-d bridge --subnet 172.25.0.0/16 mynet# Connect container containerr2 to new network Mynetdocker connect mynet con Tainer2# Use MyNet network to container conta
Docker whether to modify the file requires a reboot
Docker modify the file need to restart, in doing the project, often modify the file, for the command is not more understanding, with the attitude of trial, here on how to use, improve work efficiency.
Need to modify the code in the first phase of the project, each time before the "try" the way to get to do not
PostgreSQL -- run Supervisord on Ubuntu in Docker
I tried to use the supervisor to start nginx and PostgreSQL on the docker container boot. Use the following Dockerfile and supervisord. conf files. The above application starts, but stops after a moment. What's wrong? There is no error message in the stderr or system log file.Dockerfile:
1. [Code] [text]
FROM Ubun
Because the service needs to be containerized at work, you have recently started to learn Docker-related knowledge, and the commands commonly used for Docker are summarized as follows:1. Running the container
$ sudo docker run-i-T Ubuntu/bin/bash
The-I flag guarantees that the stdin in the container is an on-
T flag t
Docker Volume use
A data volume is a specially specified directory that leverages the container's UFS file system to provide some stable features or data sharing for the container. A data volume can be shared among multiple containers.
To create a data volume, you can create a data volume with the-v argument just after the Docker Run
Run the VIM exit command and run the vim exit command.
Note: These commands are preceded by a colon:
You can use either of the following methods to exit Vi and return to shell after editing the document.
In command mode, two uppercase letters are used for a connection. If th
Mirroring is the soul of Docker.
Docker mirroring is the basis for the Docker container to run. The important point of learning Docker is the use of mirrors.The mirrored image downloaded using the default Docker
to access the source container's resources in the receiving container (Recipient), and when we make a connection to the container, the source container is created without using -p/-P the port specified to be exposed, so how can I access the information of the source container? In order for the receiving container to be able to access the information of the source container, Docker provides two ways:
Environment variables
/etc/hosts file
path/usr/local/nginx/sbin: $PATH
#EXPOSE Map port
expose CMD ["Nginx"]
Docker build-t Whh/nginx-file:v1.
Docker run-d-it-p 93:80--name nginx
Now look at the use of Dockerfile
Mirroring can be established by using the Docker build command.
Text file Dockerfile is u
Docker Info display Docker detailsDocker Pull BusyBox ImageDocker Pull NginxDocker Images Nginx view a running mirrorDocker run--name nginx01-d-P 8099:80 Nginx uses an nginx image to start a container named NGINX01 and maps 8099 ports so we can access Nginx directly:Firefox 127.0.0.1:8099Now, assuming we don't like the Welcome page very much, we want to change to
Commands:attach attach to a running contain Er--attaches the terminal to the container 1> runs an interactive container [root@localhost ~]# Docker run-i-t Centos/bin/bash [roo t@f0a02b473067/]# 2> View the container on another window.Status [root@localhost ~]# docker ps-a CONTAINER ID IMAGE COMMAND CREATED status PO
public docker database, use the build parameter. The parameter [.] is the configuration file. Click,Dockerfile
dockerbuild-tNEW_Images.
7. Build the container according to dockerfile in the current directory [this command applies to creating httpd or nginx services in a container, and publish the ing ports under-P.]
docker
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.