(1) Pull a new CentOS image for Docker pulls centos:7.2
(2) Running a container, ready to install the necessary environment
Docker run--privileged--dns 8.8.8.8--dns 8.8.4.4-h controler--name slurm_control-i-t-v/container_data/:/data C Entos:centos7/bin/bash
(3) Install the SSH environment inside the
one directly in:
Docker images view downloaded Docker mirrors:
Docker Run-tid--name ubuntu-p 23:22 ubuntu: Name the new Docker as Ubuntu and map to Port 23
NETSTAT-APNL | grep 23 See if Port 23 is open
You can see that port 23 is open.
Docker Exec-ti Ubuntu/bin/bash
Due to work needs, to connect container remotely, the local machine is Windows, the following is the resolution steps:
1. Environment
Local: Windows
↓
Docker version 1.12
↓
Remote: Container in Docker (Ubuntu)
2. Container Installing the
1. Start a Docker container# docker Run-t -I Ubuntu/ruby:v1/bin/bash2, then in the container, install Openssh-server openssh-client# apt-get Install openssh-server openssh-client3. After completion, change the root password# passwd4. Exit the container and save the above cha
syntax and commands, and you can refer to Docker's official documentation.
2. With the Dockerfile file, you can create image files based on Dockerfile, and in the directory where Dockerfile is located, run the following command
sudo docker build-t centos6-ssh.
When the command succeeds, an image named Centos6-ssh is created and can be viewed using the sudo
Since the official website of the mirror is generally minimal installation and no SSH installation, today we have a Docker official website CentOS image as an example to install SSH.
1, to see if the mirror is CentOS, if there is a follow-up operation, not to pull one.2, build an SSH mirror.Create the
a new password, for example: 123456
Installing Vim,apt-get Install Vim-y
Install the openssh-server of the container, enter Apt-get install Openssh-server-y
After successful installation, Vim/etc/ssh/sshd_config, modify the following two configurations
Permitrootlogin YesUsepam No
Start SSH services, service s
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
Original link: Docker use Dockerfile to create a container mirror that supports SSH service self-boot
1. First create a Dockerfile file with the following contents
# Select an existing OS mirror as
the author of the base from CENTOS:CENTOS6 # mirror
maintainer fanbin Kong "kongxx@hotmail.com"
# Install the Openssh-server and sudo packages and set the sshd us
To create a bond interface, see:http://568273240.blog.51cto.com/2921150/1689541Create bridge interface directly on the configuration file, should Nmtui not succeed.# cat/etc/sysconfig/network-scripts/ifcfg-bond_connection_1Device=bond0Type=bondBonding_master=yesBootproto=noneDefroute=yesIpv4_failure_fatal=noIpv6init=noName= "Bond Connection 1"uuid=3787f827-24bd-4a2c-bd24-b9b085bcf002Onboot=yesbonding_opts= "updelay=0 resend_igmp=1 use_carrier=1 miimon=100 downdelay=0 xmit_hash_policy=0 primary_r
use Docker run to create a container, the standard operations that Docker runs in the background include:(1) Check if there is a specified image locally and download it from the public repository if it does not exist(2) Create and start a container with mirroring(3) Assigning a file system and mounting a layer of read
... Pushing tag for Rev. [5577d6743652] on {https://cdn-registry-1.docker.io/v1/repositories/linfan/employees/tags/latest }
Once the commit is complete, you can use the Docker pull command to get the image on the other node.Note: Strictly speaking, exposing the database Services container through Docker link to the Application service
1, from the container inside copy files to host.
Answer: Execute the following command in the host
Docker CP container name: The path of the file to be copied inside the container to be copied to the appropriate path of the host
Example: Assuming that the container is name
After the front upload files to the server, the server returned to the foreground of the file list in Chinese garbled, all the Chinese file name into? , the English file name is displayed normally.
The problem is positioned to find that the Multipartfile class of the background code has this exception when executing the Transterto method, but Multipartresolver and encodingfilter in the configuration file set are already UTF-8. Excludes code exceptions. KUBECTL exec enters into the
, SHELL, USER, LOGNAME, PATH,# and start a login shell."$NSENTER" $OPTS su-rootElse# Use the env to clear all host environment variables."$NSENTER" $OPTS env--ignore-environment--"$@"FiFiuse Nsenter to enter Docker containerAfter the Docker container is run, how does it enter the container to operate? At first I was us
Docker container data management and operation tutorial, docker container Data Management
Docker data volumes
What is a data volume?
Features of data volumes
Relationship between data volumes and containers
Add volumes for containers
Add permissions for data vo
Install vim In the docker container, and install vim In the docker container
When using docker containers, sometimes vim is not installed. When you press the vim command, the system prompts vim: command not found. At this time, you need to install vim, however, when you pre
port 80 on the respective container.
User namespaces
Starting with Linux 2.6.23 completed on Linux 3.8)
User and group ID spaces
The user and group IDs of the processes in user namespace can be different from the host, and each container can have a different user and group ID, and a non-privileged user on a host can be a privileged user in the user namespace ;
The conc
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.