example:
Docker swarm join 172.18.18.201: 2377
This node joined a Swarm as a worker.
View nodes on the manager node
[Vagrant @ centos01 ~] $ Docker node ls
ID NAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER
8i07v3mx5ogdz1z68iide3yrn centos03 Accepted Ready Active
Cioe124z1315ucs5rwd8n2dv * centos01 Accepted Ready Active Reachable Yes
Dfsp35af3tvt1ztf6ffcehtko centos02 Accepted Ready Active
Publis
This is a creation in
Article, where the information may have evolved or changed.
The original text connection is: http://blog.csdn.net/freewebsys/article/details/53509676Not reproduced without the permission of the blogger.Bo main address is: Http://blog.csdn.net/freewebsys
1. Start learning to build Docker images
http://study.163.com/course/courseMain.htm?courseId=1273002The course is about building with CentOS. I've been using CentOS all the ti
index.html 5cbfdbbe064b://usr/share/nginx/htmldocker commit -m "fun" 5cbfdbbe064b wyl-nginx
The previous nginx image is the nginx welcome page of the running page. We make a modification to the previous image and then run it. Then a new image will be generated.
1.3.2. Use Dockerfile to generate an image
# Create a dl directory named dockerfile [root @ bfd-v7/] # mkdir dl [root @ bfd-v7 dl] # cd dl [root @ bfd-v7 dl] # touch Dockerfile [root @ bfd-v7 dl] # vim Dockerfile # Write the upper and l
-FPM
Database: Mysql/postgresql
Cache Service: Redis/memcache
This is the simplest architectural way, in the early days of Docker development, Docker was heavily abused, for example, a mirror in the start of multi-service, log collection is still in accordance with the Syslog or other old way, the mirror capacity is very large, the base image can reach 80M, which and
a Alpine mirror-based container allows you to get a bunch of useful tools. If necessary, now you can put the shell into the container and do something when it is running.
Packaged
We see how Docker can help us compile the go code in a clean and independent environment, how to use different versions of the Go tool chain, and how to cross-compile between different operating systems and platforms.
We also
, log collection still follows Syslog or other old methods, the size of the image is very huge, and the basic image can reach 80 Mb, which is totally different from the idea proposed by Docker at the beginning. the Alpine Linux release is a lightweight Linux environment, as a basic Docker image, Docker officially recom
to specify the mirror version number, so it is recommended that you append the required mirror version number to make a distinction when you push the mirror, and if I need to pull the above mirror, I can do the following:
# because the default version defaults to latest, you can get it by default, or append: Latest (recommended)
Docker pull Registry.cn-shanghai.aliyuncs.com/hhu/docker1
first, the production of D
the container Log Service Driver # specify the logging driver. The default value is JSON-file (equivalent to docker run -- log-driver) options # specify the relevant log parameters (equivalent to docker run -- log-oPt) max-size # Set the size of a single log file, when this value is reached, log scrolling is performed. Max-file # Number of log files retained. netwo Rk_mode # specify the network mode (equiv
1 Background 1.1 Docker introductionDocker is a container engine project based on lightweight virtualization technology from Docker, the entire project is based on the go language and complies with the Apache 2.0 protocol. Today, Docker can quickly automate deployment of applications within the container, and can provide container resource isolation and security
mirror, all processes running on the host, if interested can completely PS aux query, you can find in the Docker running process, but Docker do it as chroot The encapsulation of almost the concept.
Docker true Usage
In the early days of the Docker development, because of busybox and other lightweight mirrors are not
1 PrefaceSince its inception, Docker has led the technology boom in lightweight virtualization containers. In this trend, Google, IBM, Redhat and other industry leaders have joined the Docker camp. While Docker is still primarily based on the Linux platform, Microsoft has repeatedly announced support for Docker, from p
Docker Quick Start-common docker commands 1. Introduction to docker commands 1. Introduction to docker commands
You can run the sudo docker or sudo docker HELP command to view the docker
hours 0.0.0.0:81-gt ; 80/tcp MynginxB889bfd7a6ee marksugar/nginx:8.33 "/bin/bash" hours ago up 7 hours 0.0.0.0:80-gt ; 80/tcp Nginx[Root@gitlab conf]#
3, Mark and upload the mirror
Use Docker tag to mark a mirror with the following format:10.10.239.222:5000/alpine, where 10.10.239.222 is the local warehouse address, 5000 is the warehouse port, and Alpine is th
SIZEhello-world latest c54a2cc56cbb 9 weeks ago 1.848 kBdocker imagescommand to display all of the Docker images for this machine.(iii) Online search for images:If you don't know what images are available, it might be a good idea to look it up online:Direct use docker search + [你想查找的镜像关键字] , such as:$ docker Search
Introduced inside Docker The image is running on the filesystem and the parameters are that it will never change. The container is an instance of the mirror runtime. when you're in Docker When you run a command on it, he runs the following actions:1. Check if the image exists2. if not, download3. Load the image run the action you wantView Local containers[[emailprotected]~]#dockerimagesrepository TAG IMA
large file in the transmission is absolutely a disaster, next we use multi-stage to build a relatively small image.
Multi-stage Build image
Dockerfile:
FROM golang:1.10.3 as builderWORKDIR /go/src/testRUN go get github.com/gin-gonic/ginCOPY src srcRUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main src/main.goFROM alpine:3.8WORKDIR /rootCOPY --from=builder /go/src/test/main .CMD ["./main"]
Build
$
Docker-2 learn more about docker, docker-2dockerDockerBasic concepts of images, containers, and warehousesImages
A Docker image is a read-only template.For example, an image can contain a complete CentOS operating system environment where only httpd or other applications are installed.
Images can be used to create
REPLICAS IMAGE COMMAND5lgdq3ihiez0 lvs 0/2 inits/lvs[root@centos-node4 ~]# docker service tasks helloworldID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODEeul3bus45qz3b555wekotdmo5 lvs.1 helloworld alpine Running 14 seconds Running centos-node555uhq6xxcv53xlkqv2f0be9b9 lvs.2 helloworld
Docker InspectEstimated reading Time:2 minutes
Description
Return low-level information on Docker objects Usage
Docker inspect [OPTIONS] name|id [name|id ...]
Options
Name, Shorthand
Default
Description
--format, F
Format the output using the given go template
--size, S
False
Display Total Fil
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.