[go: up one dir, main page]

0% found this document useful (0 votes)
163 views3 pages

Docker Setup for Network Engineers

This document provides instructions for setting up a Docker environment with proxy settings, installing Docker, configuring Docker to use the proxy, cloning code repositories, creating Docker networks, and running Docker containers for MySQL, PHPMyAdmin, a Laravel application called GoFree, Selenium, and a Jenkins slave. Key steps include setting proxy environment variables, enabling the Docker socket, building Docker images, and running containers on the GoFreeNetwork with exposed ports for the application.

Uploaded by

alfonzso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
163 views3 pages

Docker Setup for Network Engineers

This document provides instructions for setting up a Docker environment with proxy settings, installing Docker, configuring Docker to use the proxy, cloning code repositories, creating Docker networks, and running Docker containers for MySQL, PHPMyAdmin, a Laravel application called GoFree, Selenium, and a Jenkins slave. Key steps include setting proxy environment variables, enabling the Docker socket, building Docker images, and running containers on the GoFreeNetwork with exposed ports for the application.

Uploaded by

alfonzso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

# set up proxy environent variables, copy and type to terminal !

```sh
http_proxy="http://10.144.1.11:8080/"
https_proxy="http://10.144.1.11:8080/"
no_proxy="localhost,instance-data,127.0.0.1,169.254.169.254,.nsn-net.net,.ext.ne
t.nokia.com,.inside.nsn.com,.int.net.nokia.com,.inside.nokiasiemensnetworks.com"
export http_proxy https_proxy no_proxy
```
# Prepare for installation, update, base pack, install docker
```sh
apt-get update && \
apt-get install -y htop zip unzip nano cifs-utils screen && \
wget -qO- https://get.docker.com/ | sh
```
## DOCKER PROXY ERROR ##
```sh
mkdir /etc/systemd/system/docker.service.d
bash -c 'cat <<EOF >> /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://10.144.1.11:8080/"
EOF
'
systemctl daemon-reload
systemctl show docker --property Environment
systemctl restart docker
```
## TEST IF NEEDED : $ docker run hello-world
#### ENABLE DOCKER SOCKET FOR THE API ####
```sh
bash -c 'cat <<EOF >> /etc/systemd/system/docker-tcp.socket
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=2375
BindIPv6Only=both
Service=docker.service
[Install]
WantedBy=sockets.target
EOF
'
systemctl enable docker-tcp.socket
systemctl enable docker.socket
systemctl stop docker
systemctl start docker-tcp.socket
systemctl start docker
```
#### TEST IT WITH: ```sh docker -H tcp://127.0.0.1:2375 ps ```
# If euca is buzi, need to update /etc/resolv.conf file ...
```sh
cat <<EOF >> /etc/resolv.conf
domain eucalyptus.internal
search eucalyptus.internal americas.nsn-net.net. apac.nsn-net.net. china.nsn-net
.net. emea.nsn-net.net.
nameserver 10.135.72.108
EOF
```
# Stay in your root folder ( or cd there ) , like '/root' and type :

```sh
git clone https://gofree:Qaywsx123.@gitlabe1.ext.net.nokia.com/alfoldi/laraDocke
r.git && \
cd laraDocker && \
git clone -b test_server https://gofree:Qaywsx123.@gitlabe1.ext.net.nokia.com/PI
C/gofree.git
```
# Create shared network
```sh
docker network create gofreeNetwork
```
# RUN MYSQL DOCKER:
```sh
cd /root/laraDocker/sql/ && ./updateGoFDB.sh
```
# Install composer to gofree
```sh
/root/laraDocker/gofreeCmpsr/initGofree.sh
```
# RUN PHP MYADMIN DOCKER:
```sh
docker run -d --name phpmyadmin-gof --network gofreeNetwork --link gofsql:db -p
8080:80 phpmyadmin/phpmyadmin
```
# RUN GOFREE DOCKER:
# Build own docker images with php mysql composer etc...
```sh
cd /root/laraDocker/gofreeDckr && ../sh/bldGoF.sh && ../sh/dockToBckgrnd.sh
```
# SELENIUM
# Detached docker, run in background
```sh
docker run -d --name sele --net=gofreeNetwork --net-alias=selenium -e GEOMETRY="
1280x1024x16" -v /dev/shm:/dev/shm -p 5900:5900 selenium/standalone-firefox-debu
g:2.53.0
```
##### Check your < IP ADDR >:80 , you will see gofree login page
##### Check your < IP ADDR >:8080 , you will see gofree phpmyadmin site
##### Check your < IP ADDR >:4444 , you will see selenium hub
##### At your < IP ADDR >:3306 , mysql running
##### SELENIUM vnc connection is available with ssh tunnel (port:5900) ! ex.: ss
h -L 5900:localhost5900 root@euca
##
##
##### TODO
####### => gofree is ready to use
####### docker /var/lib/ link to /ephemeral drive
################## SETUP END ##################
#### JENKINS SLAVE IN EUCA
```sh
apt-get -y update &&\
apt-get -y upgrade &&\
apt-get -y install openjdk-8-jdk &&\
useradd -m jenkins -s /bin/bash &&\
usermod -aG docker jenkins &&\
cp /root/laraDocker/ssh/* /home/jenkins/.ssh &&\
sudo -u jenkins mkdir /home/jenkins/.ssh &&\

sudo -u jenkins cat /home/jenkins/.ssh/jenkinsOpenSSH.pub >> /home/jenkins/.ssh/


authorized_keys
```
##########################################################
##### Will stop given container name and remove from process list
```sh ./stormDocker.sh <container name> ```
##### We will login to docker bash, need to manualy start the apache2 service
##### It exist mostly debug purpose
```sh ./dockIn.sh ```

You might also like