/flask-docker

A very simple flask application that can be dockerized

Primary LanguagePython

Dockerized Flask App

Step-1: Building and Running the App

How to build it

$   docker build .  -t flask-in-docker

Run

$   docker run --rm -p 5000:5000 flask-in-docker

See output

Go to : localhost:5000

You will see:

Hello Flask World!

Also you can see the output on console using curl

$   curl   http://localhost:5000

Step-2: Publishing to Dockerhub

You will need an account with Docker Hub

Build the image

$   docker build .  -t flask-in-docker

Tag the image

Tag it with your username. Let's say your dockerhub username is XYZ. Replace XYZ below with your username

$   docker tag flask-in-docker   XYZ/flask-in-docker

Publish the image

Login to docker hub

$   docker login
# enter your credentials

And push the image

$    docker push XYZ/flask-in-docker

Verify the image is in using Dockerhub UI

Login to your dockerhub and verify the image is pushed in