Monday, July 10, 2017

Oracle Linux - Pulling OL6 on Docker

When you are running and you are planning to build a number of Docker containers based upon Oracle Linux 6 you will have to ensure that you have Oracle Linux 6 available on your docker host. Good news is, Oracle is providing a lot of docker images from hub.docker.com/u/oracle and hub.docker.com/_/oraclelinux/ and in case you need Oracle Linux 6 you can use the docker hub to pull it into your local docker engine. at this moment a number of Oracle Linux 6 and Oracle Linux 7 images are available publicly.  To pull a basic Oracle Linux 6 dockerfile you can use the docker pull command as shown in the example below:

[root@localhost etc]# docker pull oraclelinux:6
6: Pulling from library/oraclelinux

9bf12f7628ee: Pull complete 
Digest: sha256:3501cce71958dab7f0486cd42753780cc2ff987e3f92bd084c95a53d52f4f1dc
Status: Downloaded newer image for oraclelinux:6
[root@localhost etc]# 

If we now check if we indeed have the image we need to support our containers we can see that it is available for use:

[root@localhost etc]# docker images
REPOSITORY          TAG               IMAGE ID            CREATED             SIZE
oraclelinux         6                 7a4a8c404142        2 weeks ago         170.9 MB
[root@localhost etc]#

if required we can pull other images into our local docker engine. As an example we pulled oraclelinux:6-slim and oraclelinux:6.8 in the manner we pulled oraclelinux:6 which resuslts in the below example of the docker image command:

[root@localhost etc]# docker images
REPOSITORY          TAG               IMAGE ID            CREATED             SIZE
oraclelinux         6.8               6214272b9f34        24 minutes ago      170.4 MB
oraclelinux         6                 7a4a8c404142        2 weeks ago         170.9 MB
oraclelinux         6-slim            aa531a50e156        2 weeks ago         120.6 MB
[root@localhost etc]#

The Oracle Linux images are intended for use in the FROM field of an application's Dockerfile. For example, to use Oracle Linux 6 as the base of an image, specify FROM oraclelinux:6. If you now deploy an application that needs oraclelinux:6, oraclelinux:6.8 or oraclelinux:6-slim the image will already be available for you. 

No comments: