Trying to Install Docker Gpg Key Recieving Error: Curl: Option '-' Is Unknown

Trying to install DOCKER GPG key recieving error: Curl: option '-' is unknown

You seems to have a Keyboard mapping issue where the pipe | turns into a redirect symbol >. It seems more related to Digital Ocean and their Console itself where your droplet is hosted - by the look of the image in the question - according to this thread.

The first option is to use SSH to log into your droplet.

Your second option is to do this process on two steps:

wget https://download.docker.com/linux/ubuntu/gpg
sudo apt-key add gpg

Docker: How to solve the public key error in ubuntu while installing docker

EDIT: This apparently does not work any more.

Run this to add the correct key:

# Does not work any more
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Source: https://docs.docker.com/install/linux/docker-ce/ubuntu/

GPG error in Ubuntu 21.04 after second apt-get update during Docker build

That's a bug in the docker / seccomp / glibc interaction: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1916485

Signatures couldn't be verified because the public key is not available error while installing docker

Got the solution, I was trying to install docker 1.5 on a 32-bit Ubuntu, whereas the documentation says it needs 64 bit Ubuntu.

check here in Prerequisites section

docker installation failed on Ubuntu 20.04 LTS(Vmware)

For the moment, you can use :

sudo apt-get install -y docker.io

And then check with :

docker -v

docker command not found even though installed with apt-get

The Ubuntu package docker actually refers to a GUI application, not the beloved DevOps tool we've come out to look for.

The instructions for docker can be followed per instructions on the docker page here: https://docs.docker.com/engine/install/ubuntu/

=== UPDATED (thanks @Scott Stensland) ===

You now run the following install script to get docker:

curl -sSL https://get.docker.com/ | sudo sh
  • Note: review the script on the website and make sure you have the right link before continuing since you are running this as sudo.

This will run a script that installs docker. Note the last part of the script:

If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

sudo usermod -aG docker stens

Remember that you will have to log out and back in for this to take effect!

To update Docker run:

sudo apt-get update && sudo apt-get upgrade

For more details on what's going on,
See the docker install documentation or @Scott Stensland's answer below

.

=== UPDATE: For those uncomfortable w/ sudo | sh ===

Some in the comments have mentioned that it a risk to run an arbitrary script as sudo. The above option is a convenience script from docker to make the task simple. However, for those that are security-focused but don't want to read the script you can do the following:

  1. Add Dependencies
sudo apt-get update; \
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common

  1. Add docker gpg key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

(Security check, verify key fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88

$ sudo apt-key fingerprint 0EBFCD88

pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22 [S]

)


  1. Setup Repository
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

  1. Install Docker
sudo apt-get update; \
sudo apt-get install docker-ce docker-ce-cli containerd.io

If you want to verify that it worked run:
sudo docker run hello-world


The following explains why it is named like this:
Why install docker on ubuntu should be `sudo apt-get install docker.io`?

Why is Docker installed but not Docker Compose?

You also need to install Docker Compose. See the manual. Here are the commands you need to execute

sudo curl -L "https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)"  -o /usr/local/bin/docker-compose
sudo mv /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose

Note:
Make sure that the link pointing to the GitHub release is not outdated!. Check out the latest releases on GitHub.



Related Topics



Leave a reply



Submit