No description
  • Dockerfile 44.9%
  • Python 37.9%
  • Shell 17.2%
Find a file
2020-07-06 14:30:22 +02:00
kubernetes Merge branch 'master' of ssh://gitlab.pflaeging.net:1822/peter/docker-workshop 2020-07-06 14:30:22 +02:00
docker-entrypoint.sh Initial version 2019-05-22 14:23:06 +02:00
Dockerfile using python3 2020-07-06 14:24:58 +02:00
envprinter.py add commit hash 2019-08-09 16:10:06 +02:00
LICENSE Add LICENSE 2019-05-22 12:26:45 +00:00
Readme.md kubernetes working! 2019-05-28 22:10:28 +02:00

Example docker container

Minimal docker container based on:

  • alpine linux
  • python
  • flask
  • a minmal printenv app!

This docker container is for docker workshops!

Usage

build container

docker build -t mydockerhub/envprinter:0.2 .
docker tag mydockerhub/envprinter:0.2 mydockerhub/envprinter:latest
docker push mydockerhub/envprinter:0.2 
docker push mydockerhub/envprinter:latest

run container

docker rm envprinter
docker run -p 8080:5000 --name envprinter mydockerhub/envprinter:latest

Why this?

  • docker rm ... just in case there's an existing container with this name
  • docker run ... running a new container
  • -p 8080:5000 we expose the listening container port 5000 to port 8080
  • --name ... give the container a name, otherwise docker creates one ;-)

Now you can have a look at your famous application with:

Kubernetes

  • import both YAML files in directory kubernetes with ```kubectl create -f filename.yaml````
  • with kubectl get service envprinter-service you get the port on which the service is reachable

(it's the port number direct before /TCP)


Peter Pfläging peter@pflaeging.net

https://www.pflaeging.net

License: Apache 2.0