Table of Contents

We don't really need the Redhat containers, we build our own just fine. But just for the reference here's some left-over documentation on that front.

Fetch and upload those to the root dir of the Atomic Host,

https://access.redhat.com/webassets/avalon/d/Red_Hat_Enterprise_Linux_Atomic_Host-7-Getting_Started_Guide-en-US/files/mariadb_cont_2.tgz

https://access.redhat.com/webassets/avalon/d/Red_Hat_Enterprise_Linux_Atomic_Host-7-Getting_Started_Guide-en-US/files/web_cont_3.tgz

==> /root/

Write down the IP of docker0,

ifconfig docker0

Extract, modify (remove RHEL specific shit) and build the containers,

cd ~/
mkdir centosdb/
mkdir centosweb/
tar xzf mariadb_cont_2.tgz -C centosdb/
tar xzf web_cont_3.tgz -C centosweb/

cd ~/centosdb/
vi Dockerfile
FROM centos:latest
RUN yum update -y
#RUN yum-config-manager...
RUN yum -y install net-tools mariadb-server

cd ~/centosweb/
vi Dockerfile
FROM centos:latest
RUN yum -y install deltarpm yum-utils
#RUN yum-config-manager...
RUN yum install httpd procps-ng MySQL-python -y
vi action
con = mdb.connect(os.getenv('DB_SERVICE_SERVICE_HOST','172.17.0.1'), 'dbuser1', 'redhat', 'gss')

Build and run the database container,

cd ~/centosdb/
docker build -t centosdb .
cd ~/
docker run -d -p 3306:3306 --name=centosdb1 centosdb

check that the db service responds,

nc -v 172.17.0.1 3306

Build and run the web container,

cd ~/centosweb/
docker build -t centosweb .
cd ~/
docker run -d -p 80:80 --name=centosweb1 centosweb

check that the web server works,

nc -v localhost 80
curl http://localhost/index.html
check that the application works,
curl http://localhost/cgi-bin/action

References

RED HAT ENTERPRISE LINUX ATOMIC HOST 7 GETTING STARTED WITH CONTAINERS https://access.redhat.com/documentation/en/red-hat-enterprise-linux-atomic-host/version-7/getting-started-with-containers/

7.2 RELEASE NOTES https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html-single/7.2_Release_Notes/index.html#pref-Release_Notes-Preface

CHAPTER 17. ATOMIC HOST AND CONTAINERS https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html-single/7.2_Release_Notes/index.html#atomic_host_and_containers

CHAPTER 27. ATOMIC HOST AND CONTAINERS https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html-single/7.2_Release_Notes/index.html#technology-preview-atomic_host_and_containers

CHAPTER 42. ATOMIC HOST AND CONTAINERS https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html-single/7.2_Release_Notes/index.html#known-issues-atomic_host_and_containers

7.4. USING DOCKER ON RED HAT ENTERPRISE LINUX 7 https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/7.0_Release_Notes/sect-Red_Hat_Enterprise_Linux-7.0_Release_Notes-Linux_Containers_with_Docker_Format-Using_Docker.html