Pipework Fixed Container IP

Source: Internet
Author: User

What's a pipework? You can find it under your own search.

Operating system 64bit

[Email protected]:~# cat/etc/issueubuntu 14.04 LTS \ \l

Download Pipework Package and unzip

[email protected]:~# wget https://github.com/jpetazzo/ pipework/archive/master.zip[email protected]:~# unzip master.zip archive:   master.zip0633ba9dbce2d336e0f10c46819f3a9fa9c8077b   creating: pipework-master/  Extracting: pipework-master/.gitignore    inflating: pipework-master/license     inflating: pipework-master/README.md    inflating:  pipework-master/docker-compose.yml     creating: pipework-master/doctoc/   inflating: pipework-master/doctoc/dockerfile    inflating: pipework-master /pipework    inflating: pipework-master/pipework.spec  [email  Protected]:~# cd pipework-master/[email protected]:~/pipework-master# cp pipework  /usr/local/bin/

Run the container,--net=none refers to the non-bit container set up the network

[Email protected]:~# docker run-itd--name x4--net=none ubuntu97753071bf40a538fd5b9c3fbb2c4e631aa0b184244092e91eb32ed5ab7a8247

Set the IP address for the container name X4 to 0.22,172.17.42.1 is the gateway

[Email protected]:~# pipework Docker0 x4 172.17.0.22/[email protected]

Enter the container name x4

[Email protected]:~# docker-enter x4

View the IP address set by the container

[email protected]:~# ip a1: lo: <loopback,up,lower_up> mtu 65536  qdisc noqueue state unknown group default     link/ Loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00    inet 127.0.0.1/8  scope host lo       valid_lft forever preferred_ lft forever    inet6 ::1/128 scope host         valid_lft forever preferred_lft forever10: eth1: <broadcast, multicast,up,lower_up> mtu 1500 qdisc pfifo_fast state up group  Default qlen 1000    link/ether 0a:d0:18:01:1d:50 brd ff:ff:ff:ff :ff:ff    inet 172.17.0.22/24 scope global eth1        valid_lft&Nbsp;forever preferred_lft forever    inet6 fe80::8d0:18ff:fe01:1d50/64  scope link        valid_lft forever preferred_lft  forever

Install the SSH service, set the configuration sshd_config allow root login and set the password. Then restart the service to

[Email protected]:~# apt-get Install openssh-server-y
[Email protected]:~#/etc/init.d/ssh Restart * Restarting OpenBSD Secure Shell server sshd [OK]

Host login container X4,ip for 172.17.0.22

[Email protected]:~# ssh [email protected][email protected] ' s password:welcome to Ubuntu 14.04.3 LTS (gnu/linux 3.13.0-24 -generic x86_64) * Documentation:https://help.ubuntu.com/last Login:mon from 11:07:18

OK, that's it first. The container is capable of communication, and the host can ssh to manage the container.

This article is from the "Village Boys" blog, please make sure to keep this source http://noodle.blog.51cto.com/2925423/1774097

Pipework Fixed Container IP

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.