sucking redhat’s balls
We don’t really need the Redhat containers, as we build our own just fine. However for the record here’s some left-over documentation on that front.
Fetch/upload those to Docker host or Atomic Host
cd ~/images/ wget https://access.redhat.com/webassets/avalon/d/Red_Hat_Enterprise_Linux_Atomic_Host-7-Getting_Started_Guide-en-US/files/mariadb_cont_2.tgz wget https://access.redhat.com/webassets/avalon/d/Red_Hat_Enterprise_Linux_Atomic_Host-7-Getting_Started_Guide-en-US/files/web_cont_3.tgz
NOTE you might otherwise grab the CentOS equivalent
docker pull centos/mariadb
Tune the Dockerfile
(remove RHEL specific shit) and build the images
Build the database image
mkdir centosdb/ tar xzf mariadb_cont_2.tgz -C centosdb/ cd centosdb/ vi Dockerfile FROM centos:latest RUN yum update -y #RUN yum-config-manager... RUN yum -y install net-tools mariadb-server docker build -t centosdb ./
Build the web server image
mkdir centosweb/ tar xzf web_cont_3.tgz -C centosweb/ 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
also write down the IP address of the docker0
interface and tune the SQL connector accordingly
ifconfig docker0 vi action con = mdb.connect(os.getenv('DB_SERVICE_SERVICE_HOST','172.17.0.1'), 'dbuser1', 'redhat', 'gss') docker build -t centosweb ./
docker run -d -p 3306:3306 --name=centosdb1 centosdb docker run -d -p 80:80 --name=centosweb1 centosweb
check that the db service responds
nc -v 172.17.0.1 3306
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
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