-
Notifications
You must be signed in to change notification settings - Fork 7
docker Notes
- General
- macOS
- Basics
- Images
- Tagging
- Docker Hub
- Dockerfiles
- Docker Volumes
- Docker Compose
- Simple Docker workflow
- Docker file transfers
-
Docker images do not contain a kernel, kernel modules (device drivers)
-
To find the name of a docker container
docker ps -a
💳 When using docker on on macOS, the images / containers are stored in
/Users/$USER/Library/Containers/
/Users/$USER/Library/Containers/com.docker.docker/Data/
Create a docker container based on CentOS 7 and drop-in to a bash prompt.
docker container run --rm -it centos:7 bash
--rm remove the docker container when it exits.
-i interactive
-t open a pseudo tty
To create a bridged docker network
docker network create <networkName>
Docker images can be found at the below link
🐳
To show the history of a docker image
docker history <imageName>
To build a custom docker image locally within the current directory
docker image build -t <tag_name> .
-t specify a tag name for the current image being built.
To learn about tagging in docker
docker image tag --help
To push the latest changes of an image to the docker hub
docker image push <docker_username/image_name>
Make sure you are logged into the docker hub before pushing changes.
docker login
Note: after logging in with docker login
the below file is written to store docker hub credentials.
/$HOME/$USER/.docker/config.json
To preserve sanity 👩⚕️ put the things that change the least at the top of the Dockerfile, and things that change the most at the bottom of the Dockerfile.
To cleanup unused volumes left behind from Docker containers
docker volume prune
Docker compose comes bundled with the official Docker.app bundle from docker.com 💳
A simple docker workflow 💳
First get the <container_id> of the docker container to save.
docker ps -l
Then commit the changes you have made to the container.
docker commit <container_id> <docker_user_name>/<changes_made>
Then to load your container with the committed changes
docker run <docker_user_name>/<changes_made>
Current example command to launch docker image / container
docker run -it -v cross:/opt ipatch/debian-lenny-netbsd-git-tmux-jan26-remix /bin/bash
To copy some data ie, a file / directory from a docker container to the host OS
docker cp <name_of_docker_container>:/path/to/file /path/on/host/
When copying a directory and all files within the directory from a docker container to the host use a trailing
/
Example,
docker cp <name_of_docker_container>:/path/to/directory/of/files/ /path/on/host/
- Useful link about transferring files to, from, and between containers, 🔗
- Acquiring build time dependencies for Alpine Linux
-
build out table of contents for this markdown page.
#theairportwiki on freenode.net
If you find any of this info helpful on your journey 🏍 click that 👆 ⭐️ star button. It sure makes me feel warm and fuzzy 🐻 on the inside.
- AirPort Device Boot Videos
- Airport Device Disassemblies
- AirPort Device Notes
- AirPort Device Resources