(1) View the container ID (container ID) Docker ps-a
(2) Enter into the container inside Docker exec-it 6b654059476e/bin/bash ps:-it parameter is the ID of the container
(3) into the MySQL database successfully mysql-uroot-p
Root (id = 0) is the default user of the container. The creator of Docker image can add new user.
For example, the dockerfile of Jenkins image is this:
From JAVA:8-JDK RUN apt-get update apt-get install-y wget git curl zip rm-rf/var/lib/apt/lists/*
Env Jenkins_home/var/jenkins_home Env jenkins_slave_agent_port 50000 # Jenkins is run with user ' JENKINS ', uid = 1000 # If You bind mount a volume from the h
Docker manually configure the container network
The network of the Docker container is a combination of the net namespace and the virtual device, which creates a pair of virtual interfaces Veth pair at startup, which are placed in the local and container respectively, The l
In addition to Overlay,docker, another Driver:macvlan has been developed to support cross-host container networks.The Macvlan itself is the Linxu kernel module, which allows multiple MAC addresses to be configured on the same physical network card, that is, multiple interface, each of which can be configured with its own IP. Macvlan is essentially a network card virtualization technology, it's not surprisin
Restart policy:
Use the--restart parameter to set when using the Docker run.
No-container does not restart
On-failure-container launch status non-0 o'clock restart
Always-restart all the Times
https://docs.docker.com/reference/commandline/cli/#restart-policies Restart Policies
Using the--restart flag on Docker run you
In the development debugging process, you need to constantly update the code to the Git library, and then use the latest code in the GIT library to update the running Docker container, there are now two ways, it is recommended to use the second.
1. Execute the git command directly in the container and update the directories and files in the
Docker Runc Container life cycle
The lifecycle of a container involves internal program implementations and user-oriented command-line interfaces, Runc internal container state conversion operations, Runc command parameter definition operations, Docker client-defined
1. Docker run-it Ubuntu2. After entering the container, install the SSH service:sudo apt-get install Openssh-serverIt is possible to configure the software source before installing: sudo apt-get update3. Start the SSH service:/usr/sbin/sshd4. Generate public key and key for login without password:Ssh-keygenAll the way to the return, will be generated in the ~/.ssh/folder: Id_rsa, Id_rsa.pubTransfer id_rsa.p
In the previous section we prepared the Macvlan experimental environment, and today we create Macvlan network Mac_net1 in Host1 and host2: Note: also execute the same command in Host2. ①NBSP; -d Macvlan NBSP; specifies driver as Macvlan. ②macvlan Network is the local network, in order to ensure that cross-host communication, users need to manage their own IP subnet.③ Unlike other networks, Docker does not create a gateway for Macvlan, where the
How to change the default bridge DOCKER0 connection for a Docker container
The Docker0 bridge is actually a common bridge in Linux, which is more limited in its ability to perform complex operations on the container in the previous blog post.
(1) summarizes how to change the default bridge connection for the Docker
attribute access control (ABAC), Role access control (RBAC) authentication authorization policy.
Basic Object Concepts
Basic objects:
nPod
Pod is the smallest deployment unit, a pod consisting of one or more containers, in which containers share storage and network, running on the same Docker host.
nService
Service An application services abstraction that defines the pod logic set and the strategy for accessing this pod collection.
Service Agent P
Objective: To create an Apache-hosted image and launch 5 Apache containers from within a Linux external service1. Installing ApacheDocker run-t-I--name=qxy_apache centosyuminstall httpdexit2. Make imageDocker commit Qxy_apache Qxy_apache:v1. 0 [email protected]-1 ~]# Docker imagesrepository TAG IMAGE ID CREATED VIRTUAL sizeqxy_apache v1. 0 9b6f8b6054b5 seconds ago 19
The following errors are created in the container times[email protected] sample]# Docker build-t Ovcer/nginx.Sending build context to Docker daemon2015/01/07 06:43:51 Post http:///var/run/docker.sock/v1.15/build?rm=1t=ovcer%2Fnginx:dial unix/var/run/ Docker.sock:no such file or directoryWorkaround:[[email protected] sample]# Systemctl start DockerThis article is
Docker provides the rest API for creating containersHttp://192.168.150.6:8888/containers/create?name=demo-mysqlDocker MySQL container parameters, send a POST request to Docker via Restclient{"Hostname": "", "Domainname": "", "User": "", "Attachstdin": false, "attachstdout": True, "Attachstderr": True, "Tty": False, "Openstdin": false, "stdinonce": false, "ENV": [
Demand
In the process of using Docker, we sometimes have the need to configure the Docker container to the same network segment as the host. To achieve this demand, we simply will Docker container and host network card Bridge, and then to
Kafka Cluster management, state saving is realized through zookeeper, so we should build zookeeper cluster first
Zookeeper Cluster setup
First, the SOFTWARE environment:
The zookeeper cluster requires more than half of the node to survive to be externally serviced, so the number of servers should be 2*n+1, where 3 node is used to build the zookeeper cluster.
1.3 Linux servers are created using the Docker containe
Docker+kubernetes (k8s) micro-service container Practice": HTTPS://PAN.BAIDU.COM/S/16RTL8DBMFUWJKEKZRD9EMW"Let's get started.What is Kubernetes?Kubernetes (k8s) is an open source platform for automating container operations, including deployment, scheduling, and Inter-node cluster expansion. If you've ever used Docker
Configuring a LAN network with pipework for Docker multi-container
problem: Use the Pipework tool to specify the LAN IP address for the Docker container, the container cannot communicate with the LAN or the external network.
Pipework is a
A recent project has a launch container that automatically executes a script to launch an app, and finds that the container exits automatically when the script finishes executing. problem Analysis a Docker container can manage only one process at a time, and when the process exits, the
from Eth2.10, discovers that the destination address is 172.16.20.11, and looks at its own routing table:The packet is then forwarded from the eth2.20.③ through the ARP record information, the router can know 172.16.20.11 on the host2, so the data packets sent to HOST2.④HOST2 data is packets to BBOX4 based on destination address and VLAN information.The connectivity and isolation of the Macvlan network relies entirely on VLANs, IP subnet, and routing, and D
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.