|02 Image Creation, Management and Registry|
|03 Installation and Configuration|
|06 Storage and Volumes|
Docker Certified Associate
My notes while preparing for the Docker Certified Associate exam.
|Official Pdf Guide|
|Official Prep Guide|
|Another study guide|
|Another another study guide|
|Paste to Markdown|
An image is a lightweight, stand-alone, executable package that includes everything needed to run a piece of software, including the code, a runtime, libraries, environment variables, and config files.
A container is a runtime instance of an image—what the image becomes in memory when actually executed. It runs completely isolated from the host environment by default, only accessing host files and ports if configured to do so.
VS Code on Headless Pi
- When getting EACCESS permission denied, saving files with Visual Studio Code on host
sudo chown -vhR dockeradmin /home/dockeradmin
- SSH from VSCode is repeatedly failing:
Enable root login on the pi so you can run commands without sudo
Login, and edit this file:
sudo nano /etc/ssh/sshd_config
Find this line: P
Close and save file
reboot or restart sshd service using:
Set a root password if there isn't one already:
sudo passwd root
For this message when service starts:
NanoCPUs can not be set, as your kernel does not support CPU cfs period/quota or the cgroup is not mounted
This is because you cannot control cpu limits on a Pi. Remvove this from the docker compose file:
resources: limits: cpus: "0.1" memory: 50M
Ref: microsoft/vscode#48659 C:\Users\shail.vscode\extensions\ms-vscode-remote.remote-ssh-0.50.1\out
I did some more experimenting and I've found a way that works. -o RemoteCommand=none is not the only thing in this extension that prevents VS Code from establishing a working ssh session after calling sudo -u newuser -i, we also need to remove bash so that VS Code does not start an additional shell session on the remote host.
Here's a HOWTO:
make sure that sudo -u newuser -i works in a regular ssh session without requesting a password remove "-o RemoteCommand=none" and "bash" from extension.js like so sed -i s/"-o RemoteCommand=none"/""/ ~/.vscode/extensions/ms-vscode-remote.remote-ssh-/out/extension.js sed -i s/"bash"/""/ ~/.vscode/extensions/ms-vscode-remote.remote-ssh-/out/extension.js
JQ is a great tool for filtering through JSON output.
docker service inspect mystack_web | jq -r '..CreatedAt'
Here is how to install it on the Raspberry Pi
cd /tmp wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-1.5.tar.gz tar xfvz jq-1.5.tar.gz cd jq-1.5 ./configure && make && sudo make install
- Sign up for a free trial account at (Digital Ocean)[https://cloud.digitalocean.com]
- Create a Ubuntu droplet
- You will get an email with the IP address of the droplet and the root user & temporary password. SSH into the droplet and change the root user password when prompted
ssh root@[droplet ip]
- Create another user for docker and give it sudo privileges
adduser dockeradmin usermod -aG sudo dockeradmin logout
- Now, you can SSH as the docker admin user
- Install docker by running this script
wget -O - https://raw.githubusercontent.com/shailensukul/docker-certification/master/Scripts/install-docker.sh | bash
sudo apt-add-repository ppa:zanchey/asciinema sudo apt-get update sudo apt-get install asciinema
To finish hit Ctrl-D or type exit.