Skip to content

3 Containers that I use quite often in order to do my day to day job for network automation

Notifications You must be signed in to change notification settings

dderemiah/DOCKER-Tools

 
 

Repository files navigation

vPackets Tools

Gathered some code here and there on the web to create a single container that would allow me to have my own dev and tools environment no matter the platform I am working on.

vPackets Tools is a collection of 3 containers that owns different applications that I use in my day to day work when I work on a customer network or in my lab. It provides me a consistent experience and easy to setup / tear down environment. It consists of the following:

Generalities

Devops Container

This container will use the customized Dockerfile to build the first container. it has a policy to always restart itself in case of failure. We will map the laptop folder of /Users/nmichel/code/ to the container folder of /home/nmichel/devops/code/ so that all the code I edit on my laptop using visual studio is accessible by the container so we can run/test/delete it.

An interactive shell using zsh is configured in this container so we can access it using the docker exec command

NGINX Container

Official docker container from nginx https://hub.docker.com/_/nginx Port redirection : 8080 to 80. Volume mapped: /Users/nmichel/code/DOCKER - Tools/www to /usr/share/nginx/html

An interactive shell is configured in this container so we can access it using the docker exec command

SFTP Container

Custom docker container from atmoz https://hub.docker.com/r/atmoz/sftp Port redirection : 2222 to 22. Volume mapped: /Users/nic/code/DOCKER - Tools to /home/nic/sftp

You can create users but here I have just myself as an user, the password is easily changeable in order to meet the security best practices in place. An interactive shell is configured in this container so we can access it using the docker exec command

Installation

Full Devops Suite (3 containers - DevOps - NGINX - SFTP) - TO BE REWRITEN

This container is customized to match my laptop's folder so you might want to change a few lines of code in order to match your own environment.

You would need to pull the entire code and once you have done your modifications, you should build the containers and start them.

I suggest you import your own public key into the container, otherwise you would have to login with a password. Here in the docker-compose, I copy my laptop public key to the container. (/Users/nic/.ssh/id_rsa.pub:/home/nic/.ssh/keys/id_rsa.pub)

docker-compose up --build

The 3 containers will be build and ready to be used.

docker exec -it --user nic docker-tools_devops_1 /bin/zsh

DevOps Container Only

You also have the ability to just use the DevOps container.

Build the image:

docker build -t vpackets/tools:6.0.7 .  

Run the container - on Ubuntu

docker run -dit --name vpackets-tools -h vpackets-container -v /iso:/iso -v /home/nmichel/code:/home/nmichel/code -v /home/nmichel/code/docker-tools/Ansible/Ansible_variables:/home/nmichel/ansible vpackets/tools:latest 

Run the container - on MAC (updated for MBPro Work)

docker run -dit --name vpackets-tools \
        -h vpackets-container \
        -v /Users/nmichel/lab-images:/home/nmichel/lab-images \
        -v /Users/nmichel/Code/:/home/nmichel/code \
        -v "/Users/nmichel/Code/DOCKER-Tools/Ansible/Ansible_variables":/home/nmichel/ansible \
        vpackets/tools:latest

Access the container (of course, change the user/folder in your Dockerfile):

 docker exec -it --user nmichel vpackets-tools /bin/zsh

Bring down the environment. (TO REWRITE)

Full Devops Suite (3 containers - DevOps - NGINX - SFTP)

In order to bring down the environment once you have finished your work, you can just control - C from the terminal (from the terminal you have previously done docker-compose up) or type the following command:

docker-compose down

DevOps Container Only

docker stop vpackets-tools

About

3 Containers that I use quite often in order to do my day to day job for network automation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 96.8%
  • HTML 1.0%
  • Roff 0.5%
  • CSS 0.5%
  • Dockerfile 0.4%
  • Perl 0.4%
  • Other 0.4%