Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Docker: Mirroring and container operations     - Java implementation heap sort (large root heap) (Programming)

- CoreOS quick installation to get started on a PC (Linux)

- CentOS Linux Optimization and real production environment (Linux)

- CentOS 7 install Hadoop-cdh-2.5 on Mesos (Server)

- Using Linux command line and execute PHP code (Programming)

- Installation of Theano + CUDA under Ubuntu (Linux)

- Use Oracle 11g show spparameter command (Database)

- CentOS6.5 setup Oracle 11gR2 startup (Database)

- Zabbix monitors Nginx status (Server)

- How to install Linux Kernel 4.4 on Ubuntu (Linux)

- Linux SSH login without a password (Linux)

- Using the Android interface in Parcelable (Programming)

- Those functions under Linux you do not know the df command (Linux)

- Linux operating system Samba server configuration and use (Server)

- Python 3.5 await / async (Programming)

- How to update the ISPConfig 3 SSL Certificates (Server)

- SQL statement to repair SQL Server database (Database)

- Ubuntu 14.10 How to install office suite Calligra Suite 2.8.7 (Linux)

- Linux server operating system security configuration (Linux)

- Struts2 form of non-use component tags (Programming)

  Docker: Mirroring and container operations
  Add Date : 2018-11-21      
  Mirroring Operation

Lists Mirror:

$ Sudo docker images
hello-world latest 0a6ba66e537a 4 weeks ago 960 B
Get a mirror:

docker system image can be obtained from any accessible repository mirroring default obtained from the docker hub, if the download is too slow, then you can consider domestic mirror warehouse, for example dl.dockerpool.com:5000 or Ali cloud image library download.

Get a mirror with a docker docker pull command, as follows:

# Download Ubuntu12.04 version image from the official repository docker
sudo docker pull ubuntu: 12.04
Get a mirror from dl.dockerpool
sudo docker pull dl.dockerpool.com:5000/ubuntu:12.04
Note: The image obtained from a third-party warehouse https certificate problems may occur mirroring, for example:

Error response from daemon: unable to ping registry endpoint https://dl.dockerpool.com:5000/v0/
v2 ping attempt failed with error: Get https://dl.dockerpool.com:5000/v2/: tls: oversized record received with length 28012
v1 ping attempt failed with error: Get https://dl.dockerpool.com:5000/v1/_ping: tls: oversized record received with length 28012

Enter / etc / default directory, find docker file, add the following code:

DOCKER_OPTS = "- insecure-registry dl.dockerpool.com:5000"
 After the restart docker services:

sudo service docker restart
 Mirroring save and import

Save files to .tar way exists

One way to save: save

save command will mirror intact, including versioning and metadata information, the file may be relatively large.

-o: representation in the form of export files back immediately -o export file is saved in the last position is a mirror (warehouse: TAG, or mirror id)
sudo docker save -o /home/fengzheng/dockerImages/mmm.tar ubuntu: 12.04

Also using Ubuntu, on a normal machine, another machine in the following reporting error, there is no cause, and want to know the reasons stated in the comments of friends, be grateful.
Error response from daemon: open /var/lib/docker/aufs/mnt/30868777f2756735efc907c763555f869472d48ea92156c3c4b09ac22ec4adc6/.wh..wh.plnk/1003.3513973: operation not permitted

Save Second way: export

Rather, export actually save the vessel, only to save the current state of the mirror, and no version history and other information, all of the files is relatively small

-o: expressed in the form of export file is immediately behind -o export file save location is the id of the last container vessel through sudo docker ps -a view, the next will introduce
docker export -o ubuntu1204.tar d0751467dcad
Mirroring import:

docker load

sudo docker load Remove the mirror

Before deleting a mirror, we first have to rely on the container to remove the mirror (sudo docker rm container id)

Remove the mirror command docker rmi [Mirror id]

sudo docker rmi 0ac5b09d8536
Deleted: 0ac5b09d8536832e73c10e39bfda2e94781e07ebe47a206ea1c20f3f672f258a
Deleted: efbb515ae632b8ba4b8536c1eadcf1304d915c076fcadbc8c2cb6f8f2ab82013
Deleted: 5e59ab4801348d2d951c93373151bf0b4059c30bb1b58af4ce5e390114e83e1c
Deleted: be10ee96620dd1cb4bae39bb0351f241eed25b086e0c90a907a29eef2af41b34
Submit modified container, and generate a new image

When modifying an existing container, for example, to install some software, modify the configuration, you want to preserve the current modification, and generate a new image, use docker commit command, the command and the git commit command like

# -a: Modify Info -m: a note about the new mirror followed by the name of the current operation of the container id is finally to be generated
sudo docker commit -a "fengzheng" -m "this is a commit message" ae2a59b86dd9 fengzheng / ubuntu
View mirror information: docker inspect [Mirror Mirror name or id]

sudo docker inspect fengzheng / ubuntu
sudo docker inspect 085243761c41
Container operations

And start a new container

According to an image can start more than one container, the container start command is docker run

sudo docker run -t -i ubuntu: 12.04 / bin / bash


sudo docker run -t -i image id

Common parameters explained:

-t represents the distribution of a pseudo-terminal allows Docker and bind to the container standard input

-i represents the container to the standard input remains open

-d indicates to guard the way open (ie non-interactive mode, running in the background)

There is a more commonly used network configuration parameters do port mapping -p, for example, the following command to map the host port 3222 to port 22 of the container, to map the host port 3280 to port 22 of the container, is used as follows :

# -p -p Port mapping setting host port: container port
sudo docker run -t -i -p 3222: 22 -p 3280: 80 87e5b6b3ccc1 / bin / bash

See the list of containers

# View powered vessel

sudo docker ps

# See all containers

sudo docker ps -a

Start an existing container

# Id is behind the container ID
sudo docker start 8d98fd43acd4

Into the container

sudo docker attach 8d98fd43acd4

Stop the container

sudo docker stop 8d98fd43acd4

Remove the container

The container must be stopped before they can delete

sudo docker rm 8d98fd43acd4

Export containers

# 7691a814370e container id exported to the current directory name ubuntu.tar

sudo docker export 7691a814370e> ubuntu.tar

Import Container
- Father of Python: Why Python zero-based index (Programming)
- How to configure security services under Linux (Linux)
- Windows 7 hard disk to install Ubuntu 15.04 (Linux)
- CentOS installation Percona Server 5.5.42 compiling problem solve one case (Linux)
- Oracle View index and use indexes Precautions (Database)
- Deploy the project to the server from GitHub (Server)
- Linux find command usage practices (Linux)
- shell script: LVS start simple script (Server)
- How to install the Linux text editor Atom 0.124.0 (Linux)
- Ubuntu installed Gimp 2.6.11 (stable version) with PPA (Linux)
- Linux Basics Tutorial: Linux Kickstart automated installation (Linux)
- Linux operating system boot process analysis (Linux)
- Android custom title bar (Programming)
- Linux directory permissions to read and execute permissions difference (Linux)
- Linux system package manager (rpm, yum, source packages installation) (Linux)
- MySQL5.6 based GTID master-slave replication (Database)
- Linux Shell Scripting Interview Question (Linux)
- Oracle 11g forget approach SYS and SYSTEM password (Database)
- Elasticsearch 2.20 Beginners: aggregation (Server)
- How to deploy Icinga client (Server)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.