Skip to content

campbe13/docker-ecq2020

Repository files navigation

Containers, for teaching

Some containers & documentation I am working with for teaching my dockerfiles & scripts & instructions here, proofs of concept and basis for lectures / labs

I have written up some of the work in a blog: cloudnativeish blog

  • todo update docker tagging in earlier repos

Quickstart TL;DR

From my blog post A series of curated articles that I think will help a professional/teacher to quickly get started with containers.

  1. Guided exercise on play with docker: First Alpine Linux Containers Browser hosted, no need to install anything it all works in the browser and it gives you a good overview of the basic concepts:
    • Docker engine
    • Containers & Images
    • Docker hub
    • Container isolation
  2. Guided exercise on play with docker: Docker for beginners Browser hosted, still nothing to install, intro to
    • Running containers single task, interactively (console) and in the background
    • Run a custom app from docker hub, overview of basic Dockerfile directives
    • Set up a docker hub account, add & modify images, modify websites
  3. Using a simple website or JavaScript app, create your own container there are 3 parts, you can do as little or as much as you wish
    • Build the container for / with your own app, and run it
    • Make it the image available on docker hub
    • Run the container, from docker hub image
  4. This is a little more advanced but it jumps you to using persistent storage for a database container. Containers are stateless by design. In using this lab exercise you make sure the data persists on the host running the container. Note that this type of database container is normally used for testing, not in production. See Instructions MySQL container with persistent storage

general info

other repos & sites

general todo

general docker platform (client, config etc)

containers 2022

Used in teaching for 420-520, in no particular order

containers 2021

Used in teaching & videos for 420-440, in no particular order

console app

  • base image alpine
  • install & launch asciiquarium
  • youtube videos
  • tested on/runs on
    • ubuntu 20.04
    • Windows 10 pro

web app

  • base image alpine
  • install lighthttpd
  • copy index.html & react app
  • web app needs port 80 forwarded
  • tested on/runs on
    • ubuntu 20.04
    • Windows 10 pro

web app

  • base image alpine
  • install lighthttpd
  • copy index.html & react app
  • web app needs port 80 forwarded
  • tested on/runs on
    • ubuntu 20.04
    • Windows 10 pro
    • heroku

Not a container lab exercises

containers 2020

The following are in order of least to more complex

console app

working, in my hub.docker.com registry

  • uses docker/whalesay image
  • simple poc
  • I added some commands (figlet), runs to stdout
  • tested on / runs on
    • ubuntu 18.04 (created & run)
    • Fedora 31 (run from docker hub)
    • Windows 10 @ work (run from docker hub)
    • Azure registry used Dockerfile to add to Azure Container Registry (ACR) and run

console app working, in my hub.docker.com registry

  • uses openjdk 11 Oracle image
  • builds & copies a few java .class files and creates a menu
  • tested on / runs on
    • ubuntu 18.04 (created & run)
    • Fedora 31 (run from docker hub)

console app requires X11 forwarding if run remotely

working, not in docker hub

  • uses alpine latest
  • install xeyes
  • X11 -> can be done but containers are not meant to do this, really... see the Makefile
  • tested on / runs on
    • ubuntu 18.04 (created & run)

Note: Uses X11 so when running the image config needs the following, if you omit you will get Error: Can't open display:

--net=host
-e DISPLAY=${DISPLAY}  # environment
-v ${XAUTH}:/root/.Xauthority # volume

console app requires X11 forwarding if run remotely

working, not in docker hub

  • poc X11 app see also xeyes
  • todo add README.md for firefox
  • isolate firefox in a container so that things like facebook can't get as much info ??
  • X11 -> can be done but containers are not meant to do this, really... see the Makefile
  • tested on / runs on
    • ubuntu 18.04 (created & run)

console app

working, not in docker hub

  • uses alpine latest
  • install fortune, figlet, writes to stdout
  • tested on / runs on
    • ubuntu 18.04 (created & run)

web app

working, in my hub.docker.com registry

  • uses python image
  • install flask
  • hello world web page
  • exposes port 5000 (flask default)
  • tested on / runs on
    • ubuntu 18.04 (created & run)
    • Fedora 31 (run from docker hub)
    • Windows 10 @ Dawson ( run from docker hub)

web app

working, in my hub.docker.com registry

  • TODO shakespeare-jm deploy to Azure, & document it

  • uses php apache image

  • install redis

  • install app: Jeff B & Michael Mi (jm) students in PHP 2019-fall, assignment 1 for PHP

  • run php app to train model, data in redis

  • php web app, uses redis and apache

  • exposes port 80 (apache default)

  • tested on / runs on

    • ubuntu 18.04 (created & run)
    • Fedora 31 (run from docker hub)
    • heroku (pull from docker hub, push to & run from heroku registry)
  • built and tested using scripts

web app

working, in my hub.docker.com registry

  • uses python apache image
  • install redis
  • install app Eira G & Camillia E (ec) students in PHP 2019-fall assignment 1 for PHP
  • run php app to train model, data in redis
  • php web app, uses redis and apache
  • exposes port 80 (apache default)
  • tested on / runs on
    • ubuntu 18.04 (created & run)
    • Fedora 31 (run from docker hub)
    • Centos 7.x (korra, pulled from docker hub & run)
    • heroku (pull from docker hub, push to & run from heroku registry)
  • built and tested using make

web app

working, in my hub.docker.com registry

  • uses alpine base image
  • install lighttpd
  • install app javascript & static html samples for lectures in js course
  • simple web pages, uses lighttpd
  • exposes port 80 (apache default)
  • tested on / runs on
    • ubuntu 18.04 (created & run)
    • Fedora 31 (run from docker hub)
  • built and tested using make

web app

working 2020-02-27

  • simple go website, deployed to heroku using heroku cli
  • tested on / runs on
  • exposes port 8080
    • ubuntu 18.04 (created & run)
    • Heroku (released from heroku registry)

web app

working, only the php image is in in my hub.docker.com registry, the others are base images + config

  • TODO stickynotes-jb port to cloud & upload image to registry, test on fedora, Azure ??

  • TODO stickynotes-jb deploy to heroku, see shakespeare-jm & document better

  • port sticky notes app from PHP 2019, thanks to Jeff Boisvert, into a container

  • containers using docker-compose & yaml

  • a bit more complex than previous apps

    • current iteration uses internal network (name of service is hostname, pingable & used in config.ini for app
    • uses persistent storage for database
  • containers

    • apache + php app (exposes port 80)
    • mysql (no dockerfile, image from hub & config info in yaml) (port 3306 internal to container network)
    • phpmyadmin (no dockerfile, image from hub & config info in yaml) (exposes port 80)
  • tested on / runs on

    • ubuntu 18.04 (created & run)
    • Centos 7.x (korra, pulled repo & used docker-compose to build & run)

web app

working, not deployed to hub.docker.com

  • simple node.js app
  • node:alpine base image
  • exposes port 8111
  • tested on / runs on
    • ubuntu 18.04 (created & run)

web app

working, not deployed to hub docker com

  • simple springboot app, compiled using maven
  • openjdk:alpine base image
  • exposes port 8080
  • tested on / runs on
    • ubuntu 18.04 (created & run)
    • Windows 10 (run from docker hub)

console app, requires config file

working, deployed to docker hub

  • pandoc core image, based on alpine
  • uses a volume shared with the container at run time
  • tested on / runs on
    • ubuntu 18.04 (created & run)
    • Fedora 31 (run from docker hub)
    • Windows 10 Pro 64 bit (run from docker hub)

service app

working, using base image pulled from docker hub

  • mysql base image
  • uses env variables to configure the db & scripts to start up
    • ubuntu 18.04 (run from docker hub)
    • Fedora 31 (run from docker hub)
    • todo run mysql image on windows

service app

work in progress testing using postgres, was having problems installing it

  • postgres 9.3 installed on ubuntu base (working)
  • postgres base (work in progress)

NOT working, not in docker hub

  • poc X11 app see also xeyes
  • todo add README.md for chromium
  • isolate chromium in a container so that things like facebook can't get as much info ??
  • X11 -> can be done but containers are not meant to do this, really... see the Makefile
  • tested on / runs on
    • ubuntu 18.04 (created & run)

Note: Uses X11 so when running the image config needs the following, if you omit you will get Error: Can't open display:

--net=host
-e DISPLAY=${DISPLAY}  # environment
-v ${XAUTH}:/root/.Xauthority  # volume

work in progress 2020-04-28

work in progress 2020-04-16

work in progress 2020-04-16 Trying to use http://nodeschool.io/ course/workshops in containers.

work in progress 2020-04-16 porting shakespeare-ec to azure registry & running on azure

About

misc docker images for use in teaching eventually

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published