02 Lab Oracle Compute Docker
02 Lab Oracle Compute Docker
- Confidential -
LAB 6
Oracle Compute
Cloud Workshop
Page 1 of 10
Oracle Compute Cloud Service
- Confidential -
Contents
................................................................................................
Purpose................................................................ ........................................ 3
Pre-requisite ................................
................................................................................................................................
................................ 3
Docker Lightweight Virtualization Containers ................................................................
........................................... 3
Install Docker Engine ................................
................................................................................................
................................................. 4
Run a docker image ................................
................................................................................................
.................................................... 6
Decide on a base image to use. Example: oraclelinux:6.6 .........................................................
......................... 6
Customizing a Container for Application Pr
Provisioning..............................................................
.............................. 8
Page 2 of 10
Oracle Compute Cloud Service
- Confidential -
Purpose
This document shows how to deploy docker on Oracle Compute Cloud Service.
Pre-requisite
A Virtual machine with OEL 6.6 should be running on Oracle IaaS with free ssh access.
Page 3 of 10
Oracle Compute Cloud Service
- Confidential -
NOTE: Docker requires Unbreakable Enterprise Kernel >= 4.1 for the installation
installat
Just make sure you have the following things in your environment
environment.. If not please perform
the below steps to update the kernel to 4.1
[ol6_UEKR4]
name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux
$releasever ($basearch)
yum.oracle.com/repo/OracleLinux/OL6/UEKR4/$basearch/
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEKR4/$basearch/
gpgkey=file:///etc/pki/rpm-
-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
$ curl -sSL
sSL https://get.docker.com/ | sh
Page 4 of 10
Oracle Compute Cloud Service
- Confidential -
To try something more ambitious, you can run an Ubuntu container with:
Page 5 of 10
Oracle Compute Cloud Service
- Confidential -
The following commands pull the Oracle Linux 6 and Oracle Linux 7 images from the public
Docker Hub Registry, downloading them to the Oracle Linux host that's my test environment:
If no version number is specified in the docker pull command, then the latest available version is
pulled from the Docker Hub repository (for example, at the time of this publication, the latest
Oracle Linuxx version is actually Oracle Linux 7.1).
Oracle also publishes Docker container images for its verified version of MySQL on the public
Docker Hub Registry (note that docker pull mysql will pull the Ubuntu version of MySQL):
Page 6 of 10
Oracle Compute Cloud Service
- Confidential -
The command docker images lists the images available locally that I can run and customize
Specify a command to run against the image. Note: first time you try and use an image, Docker
will need to download it to your local machine.
Page 7 of 10
Oracle Compute Cloud Service
- Confidential -
Suppose that I want to provision multiple, identical web servers across multiple Linux servers in
my data center. Docker makes it easy to create a preconfigured, cookie
cookie-cutter
cutter environment in a
container image. I can then use this prebuilt image and deploy it across one or many Linux hosts.
The Docker Engine assigns an image ID to every running container instance. Because I used the
arguments -i and -t, the bash shell runs interactively, and the prompt reflects the first 12
characters (f85d55a6893f) of my running container's image ID. The --name argument specifies
a name for the running container instance. (If you choose not to enter a name, the Docker Engine
generates a random string that incorporates the name of a notable scientist, inventor, or developer
Page 8 of 10
Oracle Compute Cloud Service
- Confidential -
On the guest, I install the httpdd and perl RPM packages using yum, just as I would on any other
physical or virtual server. I also specify yum clean all to remove cache files that yum creates
during package installation, because that will ultimately save some space in the exported
container image:
Page 9 of 10
Oracle Compute Cloud Service
- Confidential -
At this point, I can configure content for the web server to display. For simplicity, I'll create a
basic opening page in the /var/www/html hierarchy on the guest:
Page 10 of 10