Containerization p1 l2
Containerization p1 l2
Containerization of Applications
Alexander Hultnér, 2022
Lecture 2
Examinerande kursmoment
Inlämning 1, Paketera mindre applikation (IG-G)
Inlämning 2, Större projekt (IG-G-VG)
Tenta (IG-G-VG)
CLI / Shell basics
Print current directory, pwd
Change directory, cd /path/to/directory/
List directory contents, ls
Create directory, mkdir directory_name
Create file, touch file_name
Move/rename file, mv old_name new_name
Copy file, cp file_name copy_name
Remove file, rm file_name
Remove directory (recursive), rm -r directory_name
Show file tree, tree
More: https://www.pluralsight.com/guides/beginner-linux-navigation-manual
CLI / Shell keyboard shortcuts
Prompt: Interactive command line
^ : CTRL
Start container
Python requirements
Virtual environments
Freeze requirements to file, pip freeze
Install from requirements file, pip install -r
Flask exercise, run existing app
Package and run a slightly larger Flask-application
Download src_p1l2.zip
Build a dockerfile based on python:3.9-slim
Set workdir
COPY over files
https://vsupalov.com/docker-arg-env-variable-guide/
EXPOSE , port to expose
Use -p to map port, format: hostPort:containerPort
-P to auto-expose to random port