Install Docker Desktop Ubuntu 22.04

Refer: https://askubuntu.com/questions/1409192/cannot-install-docker-desktop-on-ubuntu-22-04

sudo apt-get update

sudo apt-get install ca-certificates curl gnupg lsb-release

sudo mkdir -p /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

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

sudo apt update

sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

Download current version: https://docs.docker.com/desktop/install/ubuntu/

sudo apt-get install ./docker-desktop-<version>-<arch>.deb

Note: At the end of the installation process, apt displays an error due to installing a downloaded package. You can ignore this error message.

N: Download is performed unsandboxed as root, as file '/home/user/Downloads/docker-desk

It does not seem to start correctly, using this hack:

Refer: https://github.com/docker/desktop-linux/issues/94

Had to close and launch it twice, to see the application properly, it might have hung, start without logon; however additional reading said the start-up process could take some time. You might want to skip this step until you generate the keys.

/opt/docker-desktop/bin/com.docker.backend

Original Docker Desktop Target that DID NOT WORK

Menu Libre Command

/opt/docker-desktop/bin/docker-desktop

You also need to generate keys before you can logon

Refer: https://docs.docker.com/desktop/get-started/#credentials-management-for-linux-users

gpg --generate-key

You'll need to grab the generated public key from the above command, to use with pass init command, as follows:

pass init <your_generated_gpg-id_public_key>

Fix Docker DNS Cache behind VPN

It seems like Docker is caching the host's /etc/resolv.conf as it was when docker started up. So I restarted Docker after connecting to the VPN and now containers are able to resolve hosts that are in m company's DNS.

If you are developing on Ubuntu, you will need to use "--net=host" to work behind the VPN, such as this:

docker run --rm \
  -v ${PWD}:/home \
  -it \
  --net=host \
  mruckman/selenium_python:212301 /bin/bash

Install Local Kubernetes on Ubuntu 20.04

Kubernetes - K8s

Installation

Install Docker Ubuntu

Refer: https://linuxconfig.org/how-to-install-docker-on-ubuntu-20-04-lts-focal-fossa

Use the apt command to install the docker.io package

sudo apt install docker.io

Start docker and enable it to start after the system reboot

sudo systemctl enable --now docker

Optionally give any user administrative privileges to docker

sudo usermod -aG docker SOMEUSERNAME

Reboot Computer to Verify

reboot

Check docker version

docker --version

Verify Installation

docker run hello-world

Install Single node with MicroKs

Refer: https://ubuntu.com/kubernetes/install#single-node

Install latest MicroK8s

sudo snap install microk8s --classic

Optionally give any user administrative privileges to microk8s

sudo usermod -a -G microk8s mruckman
sudo chown -f -R mruckman ~/.kube

After installing MicroK8s, you should verify it is ready. Use this command, after another reboot:

microk8s.status

To block until MicroK8s is ready, use the following command:

microk8s.status --wait-ready

Accessing Kubernetes: MicroK8s embeds a kubectl and a .kubeconfig file required for accessing the installed MicroK8s. This avoids colliding with any local versions that might be already installed. Here is an example of how to use this:

microk8s.kubectl

Docker with VPN

Did NOT work with Ubuntu 20.04 installation

There's a setting with Cisco AnyConnect to "Allow local (LAN) access when using VPN (if configured)

Refer: https://www.lullabot.com/articles/fixing-docker-and-vpn-ip-address-conflicts (pdf)

By default Cisco AnyConnect was interfering with Docker running on localhost.  The fix was to have Docker use a different range of IP addresses.

$ sudo nano /etc/docker/daemon.json

daemon.json

And the restart your computer.

Install Docker on Ubuntu 20.04

Basic Installation

Refer: https://linuxconfig.org/how-to-install-docker-on-ubuntu-20-04-lts-focal-fossa

Use the apt command to install the docker.io package:

$ sudo apt install docker.io

Start docker and enable it to start after the system reboot:

$ sudo systemctl enable --now docker

Optionally give any user administrative privileges to docker:

$ sudo usermod -aG docker SOMEUSERNAME

Reboot Computer to Verify

$ reboot

Stop Docker from auto starting upon reboot

Refer: https://askubuntu.com/questions/766318/disable-docker-autostart-at-boot

sudo systemctl disable docker.service
sudo systemctl disable docker.socket

Then start and stop Docker as a service

sudo service docker start
sudo service docker stop

Check docker version:

$ docker --version

Verify Installation

$ docker run hello-world

Post Installation Items

Refer: https://docs.docker.com/engine/install/linux-postinstall/

Issue with Updating Docker on Ubuntu 18.04

Reading package lists... Done
E: Repository 'https://download.docker.com/linux/ubuntu bionic InRelease' changed its 'Label' value from 'Docker EE' to 'Docker CE'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

Refer: https://forums.docker.com/t/apt-repo-label-changed-from-ce-to-ee/82488/5

$ sudo apt-get --allow-releaseinfo-change update

API Mock Testing

Simple tool to verify you can send various requests
Refer: https://httpbin.org

Simple Debug Post Tools

  • https://webhook.site/#!/
  • https://pipedream.com

Mocking Tools

  • https://getsandbox.com
    • https://github.com/getsandbox/sandbox
  • https://www.mockable.io
  • http://jsonstub.com

You can run it locally:
$ docker run -p 80:80 kennethreitz/httpbin

Announcing Httpbin.org

June 12, 2011
The development of Requests, the Python HTTP Module for Humans, led to some annoying testing practices. Relying on random websites and services in order to test different capabilities of the HTTP client became annoying quickly. PostBin.org was perfect for testing POST request behavior, but is usless for other situations. I was hoping to extend its functionality to other request types, but it turns out that PostBin runs on the Google App Engine platform. No.

Thus, httpbin.org was born.

Example Endpoints

To get a feel for what HttpBin does, here are a few endpoint examples:

$ curl http://httpbin.org/ip :

{"origin": "::ffff:24.127.96.129"}
$ curl http://httpbin.org/user-agent :

{"user-agent": "curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3"}

How remove Docker from Ubuntu 15.10

Refer: http://tips.tutorialhorizon.com/2016/07/30/how-to-completely-uninstall-docker-from-ubuntu/

$ sudo apt-get purge docker-engine
$ sudo apt-get autoremove --purge docker-engine
$ rm -rf /var/lib/docker # This deletes all images, containers, and volumes