Mac Docker Oracle

  1. Mac Docker Oracle Software
  2. Mac Docker Oracle

Sharing my Experience with setting up Docker on Mac. I have chosen this approach with docker is because there is no proper installable available for Oracle 12c on Mac. It seems Official support was dropped from 10g onwards. I was left with either docker or using a VM which is more cumbersome.

Oracle Database Server 12c is an industry-leading relational database server. This Docker Image contains the Oracle Database Server 12 Enterprise Edition running on Oracle Linux 7. This image contains a default database in a multi-tenant configuration with a single pluggable database. We will see the steps of installing the Oracle database using docker in Mac OS in this blog. We have not successfully created an Oracle Database Enterprise Edition 19.3.0 Docker Image. To run the image use the following; docker run -name 'oracle19.3' -p 1521:1521 -p 5500:5500 -e ORACLEPDB=orapdb1 -e ORACLEPWD=topsecretpass -e ORACLEMEM=3000 -v /opt/oracle/oradata -d oracle/database:19.3.0-ee. Where -name is the name of the docker. Fortunately for Oracle Linux users, the Docker binaries are readily available from the official Oracle yum repository through the Add-ons channel. If Docker has not already been installed on your installation of Oracle Linux 7, first install and enable the Add-ons channel by using one of the following two-step procedures as root.

Install and Run Docker for Mac

Get the Docker image for Oracle

Get the docker image from https://hub.docker.com/

https://hub.docker.com/r/sath89/oracle-12c/ (This is an already available docker image with Oracle Standard Edition 12c Release 1 on Ubuntu )

docker pull <imagename>

docker images (to list the images)

docker run

Mac Docker Oracle Software

Run with 8080 and 1521 ports opened:

If -d option is present, we won’t see the errors if any, as the process runs in the background

Connect database with following setting:

Install SQLPLUS (Oracle Instant client)

Follow the steps mentioned here

Issues while connecting to Oracle from sqlplus

If you want to connect remotely to the oracle in the container, use the following arguments to docker run command

If you get the following error, while connecting to the database,

ERROR: ORA-21561: OID generation failed

Edit /etc/hosts as per the following answer

With this addition in the /etc/host file and the ORACLE_ALLOW_REMOTE=true setting, you should be able to access the Database externally (from sqlplus or from your application)

Import Data

As impdp utility is not part of Oracle instant client, you cannot use that option external to the docker container. So get into the container

The docker exec command runs a new command in a running container.

If container-name is not specified during rum, container id can be used in the above command. To get the container id, use docker ps command.

Both Impdp and sqlplus are available inside the container. You need to have the data dump file also available inside the container. The easier approach is to mount the dump file location in the local to any location in the container.

Docker

To mount location use the -v argument

When I did this first time, I got the following error

As mentioned, add the location to the shared location

Finally run the docker instance as follows

Create a new image from a container’s changes

It can be useful to commit a container’s file changes or settings into a new image.

If you do a docker images now, you can see the new image also listed

Finally run the new mage

Estimated reading time: 10 minutes

To get started with Docker EE on Red Hat Enterprise Linux, make sure youmeet the prerequisites, theninstall Docker.

Prerequisites

If you are starting from scratch, and don’t have a Linux OS installed, download and install Oracle Linux. Alternatively, use an Oracle Linux Vagrant box to run with Oracle VM VirtualBox or KVM. In many cases, your Oracle Linux system will already be set up to install software from Oracle Linux yum server. Docker-OSX is a project that makes macOS run near native using OSX-KVM inside a Docker container. Using this, you'll be able to install macOS in a QEMU virtual machine (via Docker), and run the macOS Catalina or Big Sur desktop, or boot to the OSX shell. The Docker-OSX project provides four Docker images. Fortunately for Oracle Linux users, the Docker binaries are readily available from the official Oracle yum repository through the Add-ons channel. If Docker has not already been installed on your installation of Oracle Linux 7, first install and enable the Add-ons channel by using one of the following two-step procedures as root.

Docker Community Edition (Docker CE) is not supported on Red Hat Enterprise Linux.

Docker EE repository URL

To install Docker Enterprise Edition (Docker EE), you need to know the Docker EErepository URL associated with your trial or subscription. These instructionswork for Docker EE for Red Hat Enterprise Linux and for Docker EE for Linux, whichincludes access to Docker EE for all Linux distributions. To get thisinformation:

  • Go to https://store.docker.com/my-content.
  • Each subscription or trial you have access to is listed. Click the Setupbutton for Docker Enterprise Edition for Red Hat Enterprise Linux.
  • Copy the URL from the field labeledCopy and paste this URL to download your Edition.

Use this URL when you see the placeholder text <DOCKER-EE-URL>.

To learn more about Docker EE, seeDocker Enterprise Edition.

OS requirements

To install Docker EE, you need the 64-bit version of Red Hat Enterprise Linux 7running on an x86 hardware platform, or s390x (IBM Z) architecture.

In addition, you must use the devicemapper storage driver. On productionsystems, you must use direct-lvm mode, which requires one or more dedicatedblock devices. Fast storage such as solid-state media (SSD) is recommended.

Uninstall old versions

Older versions of Docker were called docker or docker-engine. If these areinstalled, uninstall them, along with associated dependencies.

It’s OK if yum reports that none of these packages are installed.

The contents of /var/lib/docker/, including images, containers, volumes, andnetworks, are preserved. The Docker EE package is now called docker-ee.

Install Docker EE

You can install Docker EE in different ways, depending on your needs:

  • Most usersset up Docker’s repositories and installfrom them, for ease of installation and upgrade tasks. This is therecommended approach.

  • Some users download the RPM package and install it manuallyand manage upgrades completely manually. This is useful in situations such asinstalling Docker on air-gapped systems with no access to the internet.

Install using the repository

Before you install Docker EE for the first time on a new host machine, you needto set up the Docker repository. Afterward, you can install and update Docker EEfrom the repository.

Set up the repository

  1. Remove any existing Docker repositories from /etc/yum.repos.d/.

  2. Temporarily store the Docker EE repository URL you noted down in theprerequisites in an environment variable.This will not persist when the current session ends.

  3. Store your Docker EE repository URL in a yum variable in /etc/yum/vars/.This command relies on the variable you stored in the previous step.

    Store your OS version string in /etc/yum/vars/dockerosversion. Most usersshould use 7, but you can also use the more specific minor version,starting from 7.2.

  4. Install required packages. yum-utils provides the yum-config-managerutility, and device-mapper-persistent-data and lvm2 are required by thedevicemapper storage driver.

  5. Enable the extras RHEL repository. This ensures access to thecontainer-selinux package which is required by docker-ee.

    Depending on cloud provider, you may also need to enable another repository.

    For AWS:

    Note: REGION here is literal, and does not represent the regionyour machine is running in.

    For Azure:

  6. Use the following command to add the stable repository:

Install Docker EE

  1. Install the latest version of Docker EE, or go to the next step to install aspecific version.

    If this is the first time you have refreshed the package index since addingthe Docker repositories, you will be prompted to accept the GPG key, andthe key’s fingerprint will be shown. Verify that the fingerprint matches77FE DA13 1A83 1D29 A418 D3E8 99E5 FF2E 7668 2BC9 and if so, accept the key.

  2. On production systems, you should install a specific version of Docker EEinstead of always using the latest. List the available versions.This example uses the sort -r command to sort the results by versionnumber, highest to lowest, and is truncated.

    Note: This yum list command only shows binary packages. To showsource packages as well, omit the .x86_64 from the package name.

    The contents of the list depend upon which repositories you have enabled,and will be specific to your version of Red Hat Enterprise Linux(indicated by the .el7 suffix on the version, in this example). Choose aspecific version to install. The second column is the version string. Youcan use the entire version string, but you need to include at least to thefirst hyphen. The third column is the repository name, which indicateswhich repository the package is from and by extension its stability level.To install a specific version, append the version string to the package nameand separate them by a hyphen (-):

    Note: The version string is the package name plus the version up tothe first hyphen. In the example above, the fully qualified package nameis docker-ee-17.06.1.ee.2.

    Docker is installed but not started. The docker group is created, but nousers are added to the group.

  3. Edit /etc/docker/daemon.json. If it does not yet exist, create it. Assumingthat the file was empty, add the following contents.

  4. For production systems, you must use direct-lvm mode, which requires youto prepare the block devices. Follow the procedure in thedevicemapper storage driver guidebefore starting Docker.

  5. Start Docker.

  6. Verify that Docker EE is installed correctly by running the hello-worldimage.

    This command downloads a test image and runs it in a container. When thecontainer runs, it prints an informational message and exits.

Docker EE is installed and running. You need to use sudo to run Dockercommands. Continue to Linux postinstall to allownon-privileged users to run Docker commands and for other optional configurationsteps.

Upgrade Docker EE

To upgrade Docker EE:

  1. If upgrading to a new major Docker EE version (such as when going fromDocker 17.03.x to Docker 17.06.x),add the new repository.

  2. Run sudo yum makecache fast.

  3. Follow theinstallation instructions, choosing the new version youwant to install.

Install from a package

If you cannot use the official Docker repository to install Docker EE, you candownload the .rpm file for your release andinstall it manually. You will need to download a new file each time you want toupgrade Docker EE.

  1. Enable the extras RHEL repository. This ensures access to thecontainer-selinux package which is required by docker-ee.

    Alternately, obtain that package manually from Red Hat.There is no way to publicly browse this repository.

  2. Go to the Docker EE repository URL associated with yourtrial or subscription in your browser. Go torhel/7/x86_64/stable-17.06/Packages anddownload the .rpm file for the Docker versionyou want to install.

    Note: If you have trouble with selinux using the packages under the7 directory, try choosing the version-specific directory instead, suchas 7.3.

  3. Install Docker EE, changing the path below to the path where you downloadedthe Docker package.

    Docker is installed but not started. The docker group is created, but nousers are added to the group.

  4. Edit /etc/docker/daemon.json. If it does not yet exist, create it.Assuming that the file was empty, add the following contents.

  5. For production systems, you must use direct-lvm mode, which requires youto prepare the block devices. Follow the procedure in thedevicemapper storage driver guidebefore starting Docker.

  6. Start Docker.

  7. Verify that Docker EE is installed correctly by running the hello-worldimage.

    This command downloads a test image and runs it in a container. When thecontainer runs, it prints an informational message and exits.

Docker EE is installed and running. You need to use sudo to run Dockercommands. Continue to Post-installation steps for Linuxto allow non-privileged users to run Docker commands and for other optionalconfiguration steps.

Upgrade Docker EE

To upgrade Docker EE, download the newer package file and repeat theinstallation procedure, using yum -y upgradeinstead of yum -y install, and pointing to the new file.

Uninstall Docker EE

Mac Docker Oracle
  1. Uninstall the Docker EE package:

  2. Images, containers, volumes, or customized configuration files on your hostare not automatically removed. To delete all images, containers, andvolumes:

  3. If desired, remove the devicemapper thin pool and reformat the blockdevices that were part of it.

You must delete any edited configuration files manually.

Next steps

  • Continue to Post-installation steps for Linux

  • Continue with the User Guide.

requirements, installation, rhel, rpm, install, uninstall, upgrade, update
  • Docker Tutorial
  • Docker Useful Resources
  • Selected Reading

To start the installation of Docker, we are going to use an Ubuntu instance. You can use Oracle Virtual Box to setup a virtual Linux instance, in case you don’t have it already.

The following screenshot shows a simple Ubuntu server which has been installed on Oracle Virtual Box. There is an OS user named demo which has been defined on the system having entire root access to the sever.

To install Docker, we need to follow the steps given below.

Step 1 − Before installing Docker, you first have to ensure that you have the right Linux kernel version running. Docker is only designed to run on Linux kernel version 3.8 and higher. We can do this by running the following command.

uname

This method returns the system information about the Linux system.

Syntax

Options

a − This is used to ensure that the system information is returned.

Return Value

This method returns the following information on the Linux system −

  • kernel name
  • node name
  • kernel release
  • kernel version
  • machine
  • processor
  • hardware platform
  • operating system

Example

Output

When we run above command, we will get the following result −

From the output, we can see that the Linux kernel version is 4.2.0-27 which is higher than version 3.8, so we are good to go.

Step 2 − You need to update the OS with the latest packages, which can be done via the following command −

This method installs packages from the Internet on to the Linux system.

Syntax

sudo apt-get update

Options

  • sudo − The sudo command is used to ensure that the command runs with root access.

  • update − The update option is used ensure that all packages are updated on the Linux system.

Return Value

None

Example

Output

When we run the above command, we will get the following result −

This command will connect to the internet and download the latest system packages for Ubuntu.

Step 3 − The next step is to install the necessary certificates that will be required to work with the Docker site later on to download the necessary Docker packages. It can be done with the following command.

Step 4 − The next step is to add the new GPG key. This key is required to ensure that all data is encrypted when downloading the necessary packages for Docker.

The following command will download the key with the ID 58118E89F3A912897C070ADBF76221572C52609D from the keyserver hkp://ha.pool.sks-keyservers.net:80 and adds it to the adv keychain. Please note that this particular key is required to download the necessary Docker packages.

Step 5 − Next, depending on the version of Ubuntu you have, you will need to add the relevant site to the docker.list for the apt package manager, so that it will be able to detect the Docker packages from the Docker site and download them accordingly.

  • Precise 12.04 (LTS) ─ deb https://apt.dockerproject.org/repoubuntu-precise main

  • Trusty 14.04 (LTS) ─ deb https://apt.dockerproject.org/repo/ ubuntu-trusty main

  • Wily 15.10 ─ deb https://apt.dockerproject.org/repo ubuntu-wily main

  • Xenial 16.04 (LTS) - https://apt.dockerproject.org/repo ubuntu-xenial main

Docker

Since our OS is Ubuntu 14.04, we will use the Repository name as “deb https://apt.dockerproject.org/repoubuntu-trusty main”.

And then, we will need to add this repository to the docker.list as mentioned above.

Step 6 − Next, we issue the apt-get update command to update the packages on the Ubuntu system.

Step 7 − If you want to verify that the package manager is pointing to the right repository, you can do it by issuing the apt-cache command.

In the output, you will get the link to https://apt.dockerproject.org/repo/

Step 8 − Issue the apt-get update command to ensure all the packages on the local system are up to date.

Step 9 − For Ubuntu Trusty, Wily, and Xenial, we have to install the linux-image-extra-* kernel packages, which allows one to use the aufs storage driver. This driver is used by the newer versions of Docker.

It can be done by using the following command.

Step 10 − The final step is to install Docker and we can do this with the following command −

Here, apt-get uses the install option to download the Docker-engine image from the Docker website and get Docker installed.

The Docker-engine is the official package from the Docker Corporation for Ubuntu-based systems.

In the next section, we will see how to check for the version of Docker that was installed.

Docker Version

To see the version of Docker running, you can issue the following command −

Syntax

Mac Docker Oracle

Options

  • version − It is used to ensure the Docker command returns the Docker version installed.

Return Value

The output will provide the various details of the Docker version installed on the system.

Example

Output

When we run the above program, we will get the following result −

Oracle

Docker Info

To see more information on the Docker running on the system, you can issue the following command −

Syntax

Options

  • info − It is used to ensure that the Docker command returns the detailed information on the Docker service installed.

Return Value

The output will provide the various details of the Docker installed on the system such as −

Mac Docker Oracle
  • Number of containers
  • Number of images
  • The storage driver used by Docker
  • The root directory used by Docker
  • The execution driver used by Docker

Example

Output

Oracle Linux 8 Docker Install

When we run the above command, we will get the following result −

Install Docker Oracle Linux 8

Docker for Windows

Docker has out-of-the-box support for Windows, but you need to have the following configuration in order to install Docker for Windows.

System Requirements

Windows OSWindows 10 64 bit
Memory2 GB RAM (recommended)

You can download Docker for Windows from − https://docs.docker.com/docker-for-windows/

Docker ToolBox

Docker ToolBox has been designed for older versions of Windows, such as Windows 8.1 and Windows 7. You need to have the following configuration in order to install Docker for Windows.

System Requirements

Install Docker Oracle Linux 7

Windows OSWindows 7 , 8, 8.1
Memory2 GB RAM (recommended)
VirtualizationThis should be enabled.

Docker Install On Oracle Linux

You can download Docker ToolBox from − https://www.docker.com/products/docker-toolbox