Understanding Docker Container Run Errors

Asked 2 years ago, Updated 2 years ago, 350 views

I'm building an image of the Dockerfile and starting the container.
Run'docker COMMAND --help' for more information on a command.
appears.

I don't think the syntax is wrong, but is there anything strange about it?
Please let me know.

The following is also a description of the commands (processing):

Dockerfike

FROM python
WORKDIR/tmp/mydir
COPY./ex01/tmp/mydir/
CMD ["/bin/bash" ]

Docker image

PSC:\PC-Work\dockereenv\ex01>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
img_ex01_py_01 latest 5056c1313323 13 minutes ago 932MB

Docker container run results


# Create and launch a container called testpy from the image img_ex01_py_01
docker counter run-it --name testpy img_ex01_py_01


Run'docker COMMAND --help' for more information on a command.

To get more help with docker, check out your guides at https://docs.docker.com/go/guides/

windows docker vscode

2022-10-30 12:00

2 Answers

try it.

docker container run-it --name testpy img_ex01_py_01


2022-10-30 12:00

 docker counter run-it --name testpy img_ex01_py_01

You must write container instead of container.

By the way, what version of Docker is being used?
The error message could not be reproduced on hand 20.10.20.
Due to the previous question, I was wondering if the docker that I didn't expect was running.

Determine File Location

PS>Get-Command docker | Format-List

Name—docker.exe
CommandType:Application
Definition: C:\Program Files\Docker\Docker\resources\bin\docker.exe
Extension: .exe
Path: C:\Program Files\Docker\Docker\resources\bin\docker.exe
FileVersionInfo:File:C:\Program Files\Docker\Docker\resources\bin\docker.exe
                  InternalName:
                  OriginalFilename:
                  FileVersion:
                  FileDescription:
                  Product:
                  ProductVersion:
                  Debug: False
                  Patched: False
                  PreRelease: False
                  PrivateBuild: False
                  SpecialBuild: False
                  Language:

View Version

PS>docker-v
Docker version 20.10.20, build9fdeb9c

If the command is incorrect

PS>docker counter run
docker: 'countainer' is not a docker command.
See'docker --help'

container subcommand is incorrect

PS>docker container run

Usage—docker container COMMAND

Manage containers

Commands:
  attach local standard input, output, and error streams to a running container
  commit Create a new image from a container's changes
  cp Copy files / folders between a container and the local filesystem
  create a new container
  diff Inspect changes to files or directors on a container's filesystem
  exec Runa command in a running container
  export Export a container's filesystem as a target
  inspect Display detailed information on one or more containers
  kill Kill one or more running containers
  logs fetch the logs of a container
  ls List containers
  pause Pause all processes with one or more containers
  port List port mappings or a specific mapping for the container
  prune Remove all stopped containers
  rename Rename a container
  restart Restart one or more containers
  rm Remove one or more containers
  run Run a command in a new container
  start one or more stopped containers
  stats Display a live stream of container(s) resource usage statistics
  stop one or more running containers
  top Display the running processes of a container
  unpause Unpause all processes with one or more containers
  update Update configuration of one or more containers
  wait Block until one or more containers stop, then print their exit codes

Run'docker container COMMAND --help' for more information on a command.


2022-10-30 12:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.