26 July 2022

Docker Commands Cheat Sheet

run container

docker run

run container and drop to shell

docker run -it 
docker run --interactive --tty 

run container in background

docker run -d

container restart setings

docker run --restart (always|no|on-failure[:maxretries]|unless-stopped) 

remove container when exited

docker run --rm 

view containers running

docker container ls
docker container ls -a

start container

docker start

stop container

docker stop

remove container

docker rm

remove all stopped

docker container prune

rename container

docker rename

view containers metrics

docker stats []

copy file into container

docker cp file.ext :/path/to/folder/

view container information

docker inspect

Find container’s IP

docker inspect | grep IPAddress

Make a container an image

docker commit

Map container port to host port

docker run -p :
24 July 2022

Install Docker CE on Amazon Linux 2

Here is how to install docker and docker-compose on the (AWS) Amazon Linux 2 OS running on either an EC2 or Lightsail instance.

Let’s begin by opening a console or SSH session to your EC2 or Lightsail instance. You can do this from within your AWS portal or an SSH tool like Putty. The actual “how to connect” to your server is outside the scope of this article.

Once you are connected, let us start by installing any pending updates on your host.

sudo yum update

Next, we will install Docker.

sudo yum install docker

Create a new membership group for docker and add the ec2-user to it so you can run all of the docker commands without needing to use the sudo command.

sudo usermod -a -G docker ec2-user
id ec2-user
newgrp docker

Now it’s time to add docker-compose.

wget https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) 
sudo mv docker-compose-$(uname -s)-$(uname -m) /usr/local/bin/docker-compose
sudo chmod -v +x /usr/local/bin/docker-compose

Enable the docker service.

sudo systemctl enable docker.service

Start the docker service.

sudo systemctl start docker.service

Verify that the service is running.

sudo systemctl status docker.service

You can check the docker version with this command.

docker version

And lastly you can check the docker-compose version with this command..

docker-compose version

You have now installed docker and docker-compose on Amazon Linux 2.
I am going to leave off with some helpful controls manage docker on your machine.

sudo systemctl start docker.service #start docker
sudo systemctl stop docker.service #stop docker
sudo systemctl restart docker.service #restart docker
sudo systemctl status docker.service #get the status of docker
24 July 2022

Install Docker CE on Ubuntu

So how does someone install Docker on Ubuntu? Let me show you… We’re starting off with a freshly installed Ubuntu 20.04 virtual machine that has been updated but has not had anything additional added to it yet.

We will start with adding some packages that are prerequisites for using the ‘apt’ commands over HTTPS and thus for Docker.

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Next, we’ll add the GPG key for the Official Docker repository.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Then we’ll add the Docker repo to the sources for APT.

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

We’ll rerun our ‘update’ command.

sudo apt update

And the step everyone was waiting for, installing Docker.

sudo apt install docker-ce

Now we need to allow our user to run Docker commands without always needing to ‘sudo’. We can add the user we are logged in as by using this command.

sudo usermod -aG docker ${USER}

Okay now as an optional step, you can install Docker-Compose. At the time of writing this, it is on v2.7.0. You will want to check their release page and update the command below to the current version number.

mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose

Then we can set the correct permissions on docker-compose so that it will be executable.

chmod +x ~/.docker/cli-plugins/docker-compose

Now we can verify our Docker and Docker-Compose are installed by checking their versions with these commands.

docker compose version
docker version

And that is how you install Docker on your Ubuntu machine

9 July 2022

Install Docker CE on CentOS 9 Stream

Docker is an operating system virtualization tool that allows us to run applications as containers. In simplest terms, that means you are virtualizing only the application, and not creating an entire virtual machine as you would traditionally do in hypervisors like VMware, Hyper-V, or Nutanix.

Okay, that’s cool… How do we install Docker so we can start to test workloads on it? Well, let me show you how to install Docker on a virtual machine running CentOS 9 Stream.
**While I have not tested to confirm, this Docker installation method should be identical on CentOS 8 Stream, as well as for CentOS 7.x

Let us begin by shifting to Sudo mode by running this command first…

sudo su

Then the first thing to do is remove PodMan as it conflicts with Docker.

dnf -y remove podman runc

The next step is to add the Docker repo.

curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo

Update SELinux in regards to the Docker repo.

sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/docker-ce.repo

Enable the Docker repo and install Docker.

dnf --enablerepo=docker-ce-stable -y install docker-ce

With Docker installed, it is time to enable it.

systemctl start docker
systemctl enable docker

Let us view what we installed by running these two commands.

rpm -q docker-ce
docker version

Congratulations! You now have Docker installed on your machine.

You’ll probably want to install Docker Compose on your machine too so you can build and run a docker image. You can install it with this simple command.

dnf install docker-compose
26 March 2020

Folding@Home


The corona virus and COVID-19 are at the top of everyone’s mind right now. The whole world is trying to deal with this pandemic. States are issuing stay-at-home orders and just about every company is trying to figure out how to allow their staff to work from home. The least that a tech nerd like me can do is contribute a few clock cycles towards the research that will hopefully help to bring about an end to all this madness.

Folding@Home (F@H) is a project focused on disease research thru distributed computing power. They get folks like you and I to share our otherwise unused computer power (when our PCs sit idle) to solve calculations that help them get answers to their medical questions about proteins and disease. The more people that set-up the Folding@Home client in their Home-Labs or on that spare laptops/PCs laying around their house to contribute towards their project, the bigger the distributed supercomputer we create. How cool is that!

Before the global COVID-19 outbreak F@H had roughly 30,000 users globally that contributed their spare compute power. In the past couple weeks, that number has surged. They have over 400,000 users that are now contributing and that number keeps growing daily. The F@H project is now at over 470 PetaFLOPs (FLOPs = floating point operations per second) of raw compute power. That makes it over twice as fast as the fastest supercomputer in the world (2019). Not only that, but it is faster the the top seven supercomputers combined. Combined! That’s equivalent to the horsepower of 27,433,824 CPU/GPU cores. I can’t even fathom that. They are predicting that F@H will soon reach exaFLOP levels. That’s a billion billion operations per second. Totally crazy!


Here are a couple links to news articles about the recent explosion in growth around the Folding@Home project:
https://www.forbes.com/sites/jasonevangelho/2020/03/24/the-new-supercomputer-researching-coronavirus-is-powered-by-400000-ordinary-pc-users/

https://techcrunch.com/2020/03/26/coronavirus-pushes-foldinghomes-crowdsourced-molecular-science-to-exaflop-levels/


While F@H 1,200%+ increase in contributors and associated surge in demand has temporarily lead to a shortage of work units, the F@H team is working to expand and increase their capacity to serve units. In F@H terms, work units are the smaller bits of a larger workload, and are what is actually sent to each user.

It takes just minutes to setup. They have clients for Windows, Mac, and Linux, as well as support for both CPUs and GPUs. Once it is setup, it’s effortless on your part and just runs in the background.

Now that you are ready to contribute, the first step is to create a passkey. The passkey will identify you and will allow FAH to assign you work units. To create your passkey, use the link below.

https://apps.foldingathome.org/getpasskey

Just to let you know, when I signed up this week, it took a few hours for me to receive my passkey from F@H. So don’t get upset if you don’t hear from them immediately after clicking “Get Passkey”.

Once you have your Passkey, follow one of my posts (coming soon!) below to install and deploy the Folding@Home client on your system.