Enter your keyword

The DevOps Show Ep 0

The DevOps Show Ep 0

The DevOps Show Ep 0

Last week, We started the DevOps show at the Digital Factory in Mauritius. The idea is to share knowledge about DevOps and related technologies such as Docker, Kubernetes, OpenShift and Azure DevOps.

In the first meetup of the series, Renghen and Myself talked about the basics of Docker. Here’s a summary of the discussion:

  • In this demo, we are going to have 2 linux machine running Docker. We’ll build the Angular App in a Docker Container in one machine and we’ll see how easily this container can be deployed to the second linux machine.

  • I created a new angular app, build it and moved it to a linux server having Docker installed.
  • The Docker file used is below and this was also moved to the linux machine.

                         
                         FROM nginx:alpine

                         COPY nginx.conf /etc/nginx/nginx.conf

                         WORKDIR /usr/share/nginx/html
                         COPY dist/ 

  • To build the container, the Docker Build command is used.
                        sudo docker image build -t angularapp .

  • Once the image is build, you can then run the Docker Container
                       sudo docker run -d -p 3000:80 --rm angularapp

  • Now that I have tested my application, I can decide to push the code to Docker Hub so that it can be pulled from other Docker hosts.
  • To do so, you first need to login to Docker Hub, Tag the image and Push the image to Docker Hub
                    sudo docker login

                    sudo docker tag angularapp chervine/angularapp

                    sudo docker push chervine/angularapp

  • I can now spin another linux machine, pull the image from Docker Hub and run it.
                  sudo docker login

                  sudo docker pull chervine/angularapp

                  sudo docker run -d -p 3000:80 --rm chervine/angularapp

That’s it for the first DevOps show. Next one in Jan 2019.

Happy Coding!