unknown command "images" for "docker" - image

I've installed docker in windows 10 successfully.
I can run docker version and see this result
$ docker version
Client: Docker Engine - Community
Cloud integration: 1.0.4
Version: 20.10.0
API version: 1.41
Go version: go1.13.15
Git commit: 7287ab3
Built: Tue Dec 8 18:55:31 2020
OS/Arch: windows/amd64
Context: myacicontext
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.0
API version: 1.41 (minimum version 1.24)
Go version: go1.13.15
Git commit: eeddea2
Built: Tue Dec 8 19:07:44 2020
OS/Arch: windows/amd64
Experimental: false
but when I run $ docker images I receive this error
unknown command "images" for "docker"

The problem is that you're not in the right context.
From your logs I can see that you're in the "acicontext" where the $ docker images command is not available. I had the same issue when I tried to deploy a container to Azure.
To resolve this, first, run the command $ docker context list in Powershell. You should be seeing a list of contexts and the one that you're on has a star right next to its name like so :
If you want to be able to use the $ docker images command you have to go inside the right context, which in this example is "default". To do so, run $ docker context use default
Then run $ docker images again, it should be working.
You can read more about Docker context here https://docs.docker.com/engine/context/working-with-contexts/

I had the same issue, and I had to uninstall and reinstall, wich

Related

docker: command not found in bash script but can use docker in bash

I'm using bash on windows server 2019, and trying to run a simple bash script, but when it gets to this line:
# check if containers are running, and stop them if they are not for the current project
all_up_ids=$(docker ps -q);
I get a 'docker docker command not found' error. Oddly I can run docker and docker-compose in bash no problem. I have set my environment variables. The only way I was able to get docker commands to work in bash was to put this in my .bashrc file
export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
export PATH="$PATH:/mnt/c/Program\ Files/Docker/Docker/resources/bin"
alias docker=docker.exe
alias docker-compose=docker-compose.exe
Is it possible something is still wrong with my environment setup? Any assistance is appreciated.
Docker Info:
Client: Docker Engine - Enterprise
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 2ee0c57608
Built: 11/13/2019 08:00:16
OS/Arch: windows/amd64
Experimental: true
Server: Docker Engine - Enterprise
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.24)
Go version: go1.12.12
Git commit: 2ee0c57608
Built: 11/13/2019 07:58:51
OS/Arch: windows/amd64
Experimental: true
The ~/.bashrc script is being executed only for interactive terminals, that means every time you open a terminal window, ~/.bashrc gets executed in that session. So anything defined there won't be available for scripts, because they're being executed in a non-interactive mode.
I would rather put your configuration into ~/.bash_profile. That script gets executed only once when you open a login shell, so when you log in and start a script, it will be available for that script also.
It's not directly related (not Ubuntu), but has the same error message
Just in case ...on RHEL docker can be installed as podman-docker:
sudo dnf install podman-docker

Tarantool docker build issue: libprofiler.so

I simply started docker build . after cloning github tarantool/docker repository and got the error message:
cp: can't stat '.libs/libprofiler.so*': No such file or directory
This error is reproduced for every container version that I tried to build from 1.9 to 2.1. So I think I've stumbled on some well-known problem (?).
My docker version is:
Client: Docker Engine - Community
Version: 18.09.2
API version: 1.39
Go version: go1.10.8
Git commit: 6247962
Built: Sun Feb 10 04:12:31 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:13:06 2019
OS/Arch: linux/amd64
Experimental: false
Problem is in line endings. Setup your git client to not change line endings to CRLF if you're working with cross-platform projects.
Workaround in this particular case: go to gperftools_alpine.diff, change all line endings to LF, rerun the build.

Docker Enterprise daemon dies with "Windows named pipe error" during docker-compose up --build

I'm running Docker Enterprise on Windows Server 2016 (version 1607). When I run docker-compose up -d --build, Docker begins building my project, but then fails after the first set of downloads is complete with this error:
Step 1/4 : FROM microsoft/dotnet:2.1-sdk-nanoserver-1803
2.1-sdk-nanoserver-1803: Pulling from microsoft/dotnet
e46172273a4e: Download complete
1f7d468f830c: Download complete
49e2df75adc8: Download complete
5bf149b5ccf5: Download complete
8b3ace20105f: Download complete
c17187292dad: Download complete
501949accc8a: Download complete
f87c5e7b5f65: Download complete
ERROR: Windows named pipe error: The pipe has been ended. (code: 109)
After this happens, all other docker commands fail as the daemon has stopped running. I can verify this by taking a look in the Services window:
I have to manually restart the Docker service before I can execute any more docker commands.
Why is this happening and how can I fix it?
Here's the output from docker version:
PS C:\> docker version
Client:
Version: 17.10.0-ee-preview-3
API version: 1.33
Go version: go1.8.4
Git commit: 1649af8
Built: Fri Oct 6 17:52:28 2017
OS/Arch: windows/amd64
Server:
Version: 17.10.0-ee-preview-3
API version: 1.34 (minimum version 1.24)
Go version: go1.8.4
Git commit: b8571fd
Built: Fri Oct 6 18:01:48 2017
OS/Arch: windows/amd64
Experimental: true
I've made two changes, and now I am no longer getting this error:
I realized I was using an experimental Docker version (17.10.0-ee-preview-3), so I rolled back to 17.06.2-ee-16.
I learned the that version of Windows Server used by the host machine dictates which versions of Windows Server you can use inside a container. See here: https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility. My containers now use a version of Windows Server that matches the version of my host.
I think point #1 above was the key.
I have the same error after rebooting windows. I wait a couple minuts and get the message that "docker-descktop is running". Now run the command and everythink works fine.

How I can I get HOST_IP for Docker using docker-machine?

I just got a new Mac. My old Mac had a shell script that included these lines:
ACTIVE=`docker-machine active 2>/dev/null`
HOST_IP=`docker-machine ip $ACTIVE`
When I run this on the new machine it doesn't work. Just running the docker-machine active command independently I get output like this:
No active host found
I figured I try to create a default with docker-machine create default, but got this:
dial-http tcp 127.0.0.1:49719: unexpected EOF
I'm not sure what version of Docker my old Mac was running, but it was native. New Mac:
Client:
Version: 17.06.1-ce
API version: 1.30
Go version: go1.8.3
Git commit: 874a737
Built: Thu Aug 17 22:53:38 2017
OS/Arch: darwin/amd64
Server:
Version: 17.06.1-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 874a737
Built: Thu Aug 17 22:54:55 2017
OS/Arch: linux/amd64
Experimental: true
New versions of Docker for Mac no longer user VirtualBox and docker-machine. It's running on xhyve and you can run docker commands very similar to if you were running docker natively on a linux host. There's still a VM under the covers (using moby), but your scripts shouldn't see that anymore. Anything you use to connect to published ports can now connect to localhost as if it is running directly on the Mac host.

Docker: Unable to find volume real location

I'm creating a Docker container with the following command:
docker run -v /data -d ubuntu
Afterwards I try to find out the real location of the volume with:
docker inspect 12345678
and it shows that it's in /var/lib/docker/volumes/0ef2ed2715456b767fe52d38a316074c3da4a6fa82e4e42e5595c8dd8b5f0440/_data
ls: /var/lib/docker/volumes/0ef2ed2715456----/_data:
But I don't actually have a /var/lib/docker directory.
What am I missing?
I'm using Docker 1.12 on Mac.
Client:
Version: 1.12.1
API version: 1.24
Go version: go1.7.1
Git commit: 6f9534c
Built: Thu Sep 8 10:31:18 2016
OS/Arch: darwin/amd64
Server:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 17:52:38 2016
OS/Arch: linux/amd64
Docker on Mac runs a docker engine in a Linux VM, not your Mac OS, so you can't find the volume's mount point in your Mac OS file system. Please check my answer in this question: Docker Named Volume location Mac

Resources