If I use: docker stack deploy -c docker-compose.yml getstartedlab I get the error:docker: 'stack' is not a docker command.
If I run docker --help there really isn't a command like this:
rmi Remove one or more images
run Run a command in a new container
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
service Manage Docker services
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
swarm Manage Docker Swarm
tag Tag an image into a repository
Did they change the way to do this? I'm just following the turorial of there site (link to tutorial)
My docker version is:
Version: 1.12.6
API version: 1.24
Go version: go1.6.3
Git commit: 78d1802
Built: Tue Jan 31 23:47:34 2017
OS/Arch: linux/amd64
The docker stack command was introduced in the version 1.13.
As you can see in the prerequisites of the tutorial they said:
"Install Docker version 1.13 or higher"
All you need to do is upgrade the docker version from 1.12 to 1.13
Related
Hello Guys when I run docker version
My docker compose version is : docker compose version
Docker Compose version v2.2.2
Client: Docker Engine - Community
Version: 20.10.18
API version: 1.41
Go version: go1.18.6
Git commit: b40c2f6
Built: Thu Sep 8 23:11:43 2022
OS/Arch: linux/amd64
Context: desktop-linux
Experimental: true
Cannot connect to the Docker daemon at unix:///home/tonton/.docker/desktop/docker.sock. Is the docker daemon running?
I am using ubuntu 22.04 version.
In my case:
I had installed docker desktop by apt in ubuntu20.04 before, but removed it later .
And when I try to check sudo docker images today there is the same issue.
Restarting docker, chown socket and some other strange ways don't work.
Suddenly I discover that there is no such socket file in docker/desktop/, but in the default location /var/run. Then trying to restore docker default context by docker context use default makes everything come back to normal.
So I think that the remained docker-desktop context takes the responsibility.....
I'm trying to set up a local Docker Registry to keep there both Windows and Linux images.
AFAIK there is no Windows docker image for Registry. So I can't set up my own registry on Windows host. Am I right?
Ok, I set up a linux box, got there a registry:
# docker version
Client:
Version: 18.09.0-ce
API version: 1.39
Go version: go1.10.8
Git commit:
Built: Mon Jan 28 16:51:31 2019
OS/Arch: linux/amd64
Experimental: true
Server:
Engine:
Version: dev
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 4d60db4/18.09.0
Built: Thu Jan 17 13:27:44 2019
OS/Arch: linux/amd64
Experimental: true
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7db5178d0215 registry "/entrypoint.sh /etc…" 20 hours ago Up 4 minutes 0.0.0.0:5000->5000/tcp MyReg
and then I want to pull there a windows tagged image NOT to run, just to put there my own tag and let my users to pull it from me after that.
But I can't because the architect problem.
I've already set both the engine and the client to Experimental but still get this error:
# docker pull --platform windows/amd64 hello-seattle
Using default tag: latest
latest: Pulling from library/hello-seattle
image operating system "windows" cannot be used on this platform
So the questions are:
1. Can I have one registry to keep there Linux AND Windows images simultaneously?
2. How should I properly pull Windows tagged image onto linux hosted docker registry to keep it there and redistribute after?
Ran into sort of same problem, so following just to hear a solution.
I noticed that stefanscherer on docker hub has an docker registry image for windows, but i dont like to run unofficial images.
In my case i'm building an asp.net core application that builds an aspnet:60 base docker image that supports both linux and windows. I want the build/deployment process to run on a dedicated build host, which seems have to be installed with a windows OS to build windows containers.
I like to keep my docker registry local instead of using docker hub (at least until it reaches some production ready state). I believe i have to install a linux host as well in order to host a docker registry or build the docker registry from source for windows.
docker stack is not in the list of docker commands.
But it works fine. Is it a bug or what? Here is the command list of docker:
Management Commands:
config Manage Docker configs
container Manage containers
image Manage images
network Manage networks
node Manage Swarm nodes
plugin Manage plugins
secret Manage Docker secrets
service Manage services
swarm Manage Swarm
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
Commands:
attach Attach local standard input, output, and error streams to a running container
build Build an image from a Dockerfile
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Run a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a Docker registry
logout Log out from a Docker registry
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
ps List containers
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
version Show the Docker version information
wait Block until one or more containers stop, then print their exit codes
Run 'docker COMMAND --help' for more information on a command.
As you can see, there is no stack command.
Here is my docker version:
☁ docker-research [master] ⚡ docker version
Client:
Version: 18.03.0-ce
API version: 1.37
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:06:22 2018
OS/Arch: darwin/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.05.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.10.1
Git commit: f150324
Built: Wed May 9 22:20:42 2018
OS/Arch: linux/amd64
Experimental: false
update 1
I also think does stack command will show in a swarm node? So, I do a test using docker-machine ssh myvm1 'docker'. Unfortunately, there is still no stack command
I agree with #novaline it seems like a bug in the documentation.
Also, if you try docker stack --help
You will get:
Usage: docker stack COMMAND
Manage Docker stacks
Options:
Commands:
deploy Deploy a new stack or update an existing stack
ls List stacks
ps List the tasks in the stack
rm Remove one or more stacks
services List the services in the stack
Run 'docker stack COMMAND --help' for more information on a command.
The command is there, but...
$ docker stack ls
Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.
you have to run the Docker Engine in swarm mode.
from the Docs:
When running Docker Engine in swarm mode, you can use docker stack deploy to deploy a complete application stack to the swarm. The deploy command accepts a stack description in the form of a Compose file.
Note: If you're trying things out on a local development environment, you can put your engine into swarm mode with docker swarm init.
If you've already got a multi-node swarm running, keep in mind that all docker stack and docker service commands must be run from a manager node.
Why does my Docker client recognize docker build but not docker image build? Is the client too old? Does CLI depends on client or server?
I believe I got my Docker client and server by installing the latest Docker toolbox.
$ docker version
Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 06:14:34 2016
OS/Arch: windows/amd64
Server:
Version: 18.01.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: 03596f5
Built: Wed Jan 10 20:13:12 2018
OS/Arch: linux/amd64
$ docker image build
docker: 'image' is not a docker command.
See 'docker --help'.
$ docker build
"docker build" requires exactly 1 argument(s).
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
The client version is old. The new commad structure is supported with client 1.13. Check Docker CLI restructured.
There was a refactoring for the command line client to have the form:
docker <management command> <command>
The new command structure still supports the old way. For instance, the old docker ps is an alias for docker container ls and the old docker build is alias to docker image build.
As you can see from the documentation in your client version docker image build does not exist yet.
I'm trying to build a docker image remotely with Bluemix using the following command:
cf ic build -t dude -f docker/production/Dockerfile .
However I consistently receive the error:
Sending build context to Docker daemon 32.57 MB
Error response from daemon: Build aborted with error: "filename 'Dockerfile' not found"
Moving the Dockerfile to the root of the project initially looks like it is hanging but then does seem to succeed.
Per the documentation the docker build command is supported and thus I'd expect the -f option to also work. Maybe this is not the case?
Any ideas or others who have managed to get this to work? Here is the Docker version information:
# docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.3
Git commit: a34a1d5
Built: Fri Nov 20 17:56:04 UTC 2015
OS/Arch: darwin/amd64
Server:
Version: 3.0
API version: 1.20
Go version:
Git commit:
Built: 2016-02-10T16:22:49
OS/Arch: Bluemix Containers/
Reading the documentation at
https://console.ng.bluemix.net/docs/containers/container_cli_reference_cfic.html#container_cli_reference_cfic__build
I suppose that the -f option isn't supported yet by the cf ic CLI of IBM Bluemix Containers.
Anyway you have the opportunity of using docker native commands on Bluemix, as described here
https://console.ng.bluemix.net/docs/containers/container_cli_ov.html#container_cli_ov
Whenever possible, run docker commands as for example docker run
During login, copy and paste the environment variables that are provided in the terminal.
DOCKER_HOST sets the Docker host to IBM Containers.
DOCKER_CERT_PATH sets the location of the authentication keys for the IBM Containers plug in for Cloud Foundry.
DOCKER_TLS_VERIFY uses TLS and verifies the remote server.
Then, you can use the Docker CLI directly for the current session to run supported Docker commands. Some exceptions require the use of cf ic commands to perform tasks specific to IBM Containers, such as setting a namespace.
According to that, after login through cf ic login, you could switch your local runtime docker engine to Bluemix registry (and back) setting the values of
DOCKER_HOST
(and DOCKER_CERT_PATH/DOCKER_TLS_VERIFY, but these values won't change)
to the values suggested by the output of cf ic login (and to the original values to switch back to your local environment)
In the IBM Containers documentation, a list of all the supported and unsupported Docker options for cf ic commands is being worked on. This is an ongoing effort to compile, so there are still some options that are not included here yet.
https://console.ng.bluemix.net/docs/containers/container_cli_reference_native-docker.html#container_cli_reference_native-docker