Last active
July 5, 2019 07:58
-
-
Save gophry/f748698cd1920f7f2128 to your computer and use it in GitHub Desktop.
Docker - Custom Setup/CENTOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Linux user Group - Create a docker Group | |
groupadd docker | |
wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O docker | |
chmod +x docker | |
Move the docker file to mv docker /usr/bin/ | |
gpasswd -a admin docker {admin can be any of your docker admin users} | |
2. Folder Structure | |
sudo mkdir -p /docker/var/lib | |
sudo chown root:docker -R /docker/ | |
/*this folder stores images and docker binary creates a list of folders for its purposes. Mounting the files on a seperate disk or partition is recommended */ | |
3. Bridge Interface | |
a. create a file for bridge interface configuration /etc/sysconfig/network-scripts/ifcfg-bridge0 | |
b. place the following configuration in the file: | |
DEVICE=bridge0 | |
TYPE=Bridge | |
BOOTPROTO=static | |
IPADDR=10.20.20.1 | |
NETMASK=255.255.255.0 | |
ONBOOT=yes | |
STP=no | |
4. Docker Daemon | |
sudo docker -d -b bridge0 --dns="8.8.8.8" --group="docker" --graph="/docker/var/lib" --selinux-enabled=false | |
5. Docker Systemd - docker.service | |
A. create docker.service file on the following path /usr/lib/systemd/system/ | |
Copy the following: | |
***************************************************** | |
[Unit] | |
Description=Docker Application Container Engine | |
Documentation=http://docs.docker.com | |
After=network.target | |
[Service] | |
Type=notify | |
ExecStart=/usr/bin/docker -d -b bridge0 --dns="8.8.8.8" --group="docker" --graph="/docker/var/lib" --selinux-enabled=false | |
LimitNOFILE=1048576 | |
LimitNPROC=1048576 | |
MountFlags=private | |
[Install] | |
WantedBy=multi-user.target | |
***************************************************** | |
B. Enable and the start service | |
sudo systemctl enable docker.service | |
sudo systemctl start docker.service | |
C. Test the connectivity to the daemon | |
docker version | |
docker pull centos | |
docker images |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Docker Base Images - Centos/Ubuntu as required. | |
a. docker pull centos | |
b. docker pull ubuntu | |
2. Docker Containers - Basic | |
a. Hard Disk Space: | |
b. Networking Bind to bridge: | |
c. RAM: | |
d. Base Host mount point: | |
3. Docker Containers - Application | |
a. OPEN-JDK | |
b. JBOSS Wildfly | |
c. LAMP Stack | |
4. Exposing services |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment