Create Python Flask Docker Container

Create a folder and change to the folder mkdir python-flask cd python-flask Create file vi Dockerfile Add following content FROM python:2.7-slim WORKDIR /app COPY . /app RUN pip install -r requirements.txt EXPOSE 8080 CMD [“python”, “app.py”] Create file requirements.txt, add “Flask” to it. echo “Flask” > requirments.txt Now lets create our Python Flask Application vi … Read more

Docker container start on boot

Docker

To set a docker container to start on system reboot, run docker update –restart=unless-stopped CONTAINER_ID Replace CONTAINER_ID with actual ID of your container. You can specify –restart=unless-stopped On creating docker container, for example docker run -d -p 80:80 –restart=unless-stopped nginx

Docker Nginx Proxy

Docker Nginx Proxy allow you to run multiple docker containers on same server behind nginx proxy. This is done using https://github.com/jwilder/nginx-proxy To do this, you need a server with port 80 and 443 unused. To setup nginx proxy, run following cd /root/ git clone https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion.git cd docker-compose-letsencrypt-nginx-proxy-companion cp .env.sample .env ./start.sh This will start nginx … Read more

Deploy Docker Image using Elastic Beanstalk

First create a file docker-eb-run.json with following content { “AWSEBDockerrunVersion”: “1”, “Image”: { “Name”: “bitnami/tomcat” }, “Ports”: [ { “ContainerPort”: “8080” } ] } here i used docker container bitnami/tomcat, you can use any container. Login to AWS Console, go to AWS Elastic Beanstalk page. Click Get Started. On next page, it ask for Application … Read more

Docker Delete all images

Before you can delete a docker image, you need to delete any container that is based on this image. So see how to delete all docker containers, see Delete all docker containers To list all available docker images, run docker images To just display image ID only, run with -q option docker images -q Now … Read more

Red Hat acquires CoreOS for $250 mililon

CoreOS is a container-optimized Linux operating system to be used under docker/Kubernetes. On January 30, 2018, Red Hat, Inc. announced that it is acquiring CoreOS for $250 million. Founded in 2013, CoreOS was created with a goal of building and delivering infrastructure for organizations of all sizes that mirrored that of large-scale software companies, automatically … Read more

Running MySQL inside docker

On a Cpanel Server with an old version of PHP, one of the applications requires MySQL 5.6 to work. Since the PHP version is no longer supported, updating MySQL using WHM will upgrade PHP to one of the supported versions, which may break existing sites. So I decided to install MySQL inside docker. First, create … Read more

docker

If you need to try docker on web without installing on your computer, use https://labs.play-with-docker.com Docker Install Docker Basics Docker Delete Conatiner/Image Run Application in Docker Container Creating Docker Images Docker Tools Using Docker To install docker, run Install docker compose Check docker is working To list all running docker containers