Check out my earlier post on an introduction to WebLogic on Docker!
To get started we need to prepare our environment to run Docker – these really are the only dependencies that you need to satisfy for running Docker containers.
For the record, I am running Oracle Linux 7 as a VirtualBox image. All the commands shown here will be specific to my system.
Install GIT
Git will be used to access Oracle’s github repository. Instructions for installing git on various platforms can be found here.
1 |
$ sudo yum install git |
Add Docker Repo
Here we will install the docker engine. Instructions for other platforms can be found here.
In OL7 you need to add the Docker repo.
1 2 3 4 5 6 7 8 9 |
$ cat >/etc/yum.repos.d/docker.repo <<-EOF [dockerrepo] name=Docker Repository baseurl=https://yum.dockerproject.org/repo/main/oraclelinux/7 enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg EOF $ |
Install Docker Engine
Once the repo has been added you can install Docker Engine.
1 |
$ sudo yum install docker-engine |
Start Docker Service
On OL7 the syntax is:
1 |
$ sudo systemctl start docker.service |
By default, you have to be root or sudo any time you want to invoke docker commands. If you want to allow your user to run docker commands, add yourself to the docker group.
1 |
$ sudo usermod -a -G docker <username> |
Verify Installation
Ok, let’s see if we have installed Docker properly.
We can run a test image in a Docker container to verify everything is working properly.
1 |
$ docker run hello-world |
The hello-world docker image should be executed in a docker container. Verify you see the following output from the Hello World program.
In the next article, we will clone the Oracle GitHub repo and build the Oracle JRE 8 Docker image. Step 2: Build JRE Image.