Tag Archives: docker

OpenVPN in a Docker container

Run a docker container:

export MY_IP=$(curl -s https://api.ipify.org)

sudo docker run -it --rm --cap-add=NET_ADMIN -p 1194:1194/udp -e HOST_ADDR=$MY_IP --name dockovpn alekslitvinenk/openvpn

or

sudo docker run -it --rm --cap-add=NET_ADMIN -p 1194:1194/udp -e HOST_ADDR=$MY_IP --name dockovpn alekslitvinenk/openvpn -v openvpn_conf:/opt/Dockovpn_data

to persist generated files in volume storage.

Type Ctrl+P then Ctrl+Q to turn interactive mode to daemon mode.

Determine its IP address:

sudo docker ps
sudo docker inspect dockovpn | grep IPAddress
(more…)

Binding Docker container ports to the host on Ubuntu 18.04 inside Hyper-V on Windows 10

The binding did not work for me until I switched from Internal Virtual Switch to External Virtual Switch and while switching I were getting the following error:

[Window Title]
Virtual Switch Manager for MY-MACHINE

[Main Instruction]
Error applying Virtual Switch Properties changes

[Content]
Failed while adding virtual Ethernet switch connections.

[Expanded Information]
External Ethernet adapter 'Realtek PCIe GBE Family Controller' is already bound to the Microsoft Virtual Switch protocol.

until I switched Hyper-V Extensible Virtual Switch off on my network adapter properties page (after I created External Virtual Switch it switched on back):

(more…)

Running Oracle database (v12,18,19) in a docker container on Ubuntu 18.04.

Clone the repository with the official Oracle docker images:

git clone https://github.com/oracle/docker-images

Install docker, download Oracle Database, put it to the directory docker-images/OracleDatabase/SingleInstance/dockerfiles/18.3.0 containing the Dockerfile and run the following commands to build and run Enterprise Edition:

cd docker-images/OracleDatabase/SingleInstance/dockerfiles/18.3.0
mv ~/Downloads/LINUX.X64_180000_db_home.zip .
# Fix a small bug in Dockerfile, see https://github.com/oracle/docker-images/issues/1468
sed -i 's/V981623-01/LINUX.X64_180000_db_home/g' Dockerfile
sudo docker build -t oracle/database:18.3.0 --build-arg DB_EDITION=EE .
sudo docker run -d -it --rm --name oracle18 oracle/database:18.3.0
sudo docker logs oracle18 --tail 100
sudo docker logs oracle18 | grep -i password

and the following commands to build and run Standard Edition 2 (it does not require V981623-01.zip):

sudo docker build -t oracle/database-se:18.3.0 --build-arg DB_EDITION=SE2 .
sudo docker run -d -it --rm --name oracle18se oracle/database-se:18.3.0
sudo docker logs oracle18se --tail 100

the first string of the docker output contains the generated password for SYS, SYSTEM and PDBADMIN.

(more…)

Running PHP 5.3/5.6 in a Docker container with Nginx on Ubuntu 16.04

The docker installation procedure depends on the system architecture that can be determined with the following commands:

cat /proc/cpuinfo
dpkg --print-architecture

After I installed Docker, I successfully run its test application:

docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b04784fba78d: Pull complete
Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
Status: Downloaded newer image for hello-world:latest

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/

(more…)