Installation of oracle-xe-11g database using Docker under mac os

Keywords: Docker Oracle Mac sqlplus

First, install docker.

In mac os, you need to install docker through docker-toolbox. You can download docker here. docker-toolbox

Download the corresponding version of the pkg file and double-click to open the installation

Pictured


next can be installed.

There are two more items in your Application after installation

Pictured



The first one is the docker command line interface and the second one is that the docker gui operating interface belongs to the built-in version.

Here we use Terminal

Click Open Docker Terminal

It will automatically initialize and create a docker-machine named default for us.

Pictured



Don't rush to install oracle at this point. We need to mirror our docker domestically.

See my other article for details on how to set it up. Doker Sets Ali Cloud Mirror Image

Next we initialize the environment variable

eval "$(boot2docker shellinit)"

Test whether docker is installed successfully

docker run hello-world

The console output indicates successful installation as follows

Hello from Docker!

This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

1. The Docker client contacted the Docker daemon.

2. The Docker daemon pulled the "hello-world" image from the Docker Hub.

3. The Docker daemon created a new container from that image which runs the

executable that produces the output you are currently reading.

4. The Docker daemon streamed that output to the Docker client, which sent it

to your terminal.

To try something more ambitious, you can run an Ubuntu container with:

$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:

https://cloud.docker.com/

For more examples and ideas, visit:

https://docs.docker.com/engine/userguide/

Now that our docker has been installed successfully, we can pull our oracle 11g database.

#Download mirroring

docker pull alexeiled/docker-oracle-xe-11g

#Start the image as a container and name it oracle

docker run -h "oracle" --name "oracle" -d -p 49160:22 -p 49161:1521 -p 49162:8080 alexeiled/docker-oracle-xe-11g

At this point oracle has been installed into our docker

We can docker ps.



49160 is our ssh connection to the corresponding port

49161 is the port where we connect sqlplus

49162 is our corresponding port to connect oem

oracle database connection corresponding information

hostname: 192.168.99.100(adopt boot2docker ip Get)

port: 49161

sid: xe

username: system

password: oracle

SYS Password oracle

Next we start the container and enter the sqlplus interface

Use docker exec-it <CONTAINER> <COMMAND>: Execute commands in containers and output results

docker exec -it 0deb75d61474  /bin/bash

Among them, 0deb75d61474 is our containerID.

Container information can be queried through dockers

Next we can enter the sqlplus interface.

Pictured



At this point, on behalf of our mac os, using docker to install oracle 11g has been successful

Posted by grissom on Mon, 10 Dec 2018 22:15:05 -0800