Docker
Blah
Docker
How it works
- a container is a process
Cheatsheet
Attaching to Container
Since I leave containers running in some cases for regular usage, I need to be able to enter and exit the container.
Attach
1
docker attach CONTAINER
Note: There is also nsenter which I should look at again.
Also, seems like maybe exec is more useful for what I want…
1
docker exec -it [container] bash
Detach
It seems that the way to do this is ctrl+p, ctrl+q.
Building Containers
Building a container simply creates an image which can then be used to launch a specific instance of a container.
Assuming the current directory contains the Dockerfile
1
docker build -t NAME:TAG .
For classes…
1
docker run -it -v [repolocation]:/root/website -p 9999:4000 --name [course] course-website:1.0
microk8s
what in tarnation…
1
tar -zc original | kubectl run [podname] --rm -i --image=localhost:32000/[image] --command -- /bin/bash -c "tar -zxf - ; cd original; mvn test"