Closed ydanylko closed 1 month ago
docker create
creates a container, but doesn't start it, so the container will have status created
; docker ps
/ docker container ls
by default only shows containers that are running.
docker create -t -i -w /mnt/studentfiles/2024/2024MBI02/ nextgenusfs/funannotate --name annotate
Unable to find image 'nextgenusfs/funannotate:latest' locally
latest: Pulling from nextgenusfs/funannotate
544676cb5e57: Pull complete
70e70a21d5b4: Pull complete
6e7811040d62: Pull complete
61a6b81c65dd: Pull complete
Digest: sha256:e634998bd023670bad59d4982862efb47389b1fe5d052432a7610dc98e5cf5bd
Status: Downloaded newer image for nextgenusfs/funannotate:latest
204bf12852d551855f4484989ce37ed0052c1abdc3b507e2e56dfdfeedd78efb
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
To show containers that are not running, you can use the -a
/ --all
option;
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
204bf12852d5 nextgenusfs/funannotate "--name annotate" 20 seconds ago Created stoic_archimedes
That said, I suspect you intended to pass --name annotate
as option for docker (to give the container a name); the order of arguments is important, because anything passed after the image name is passed as command to be run in the container (or to be used as arguments for the container's entrypoint); in your case --name annotate
is passed as command for the container, which can also be seen in the docker ps -a
output above.
--name annotate
is not a valid command in the container, so when starting the container, you'll see that it fails;
docker start 204bf12852d5
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "--name": executable file not found in $PATH: unknown
Error: failed to start containers: 204bf12852d5
If your intent was to name the container annotate
, that option should go before the image name; also see the "usage" for the docker create
command;
docker create --help
Usage: docker create [OPTIONS] IMAGE [COMMAND] [ARG...]
Create a new container
Changing the --name
to be before the image prevents that failure;
# remove the faulty container
docker rm stoic_archimedes
# crate a new container
docker create -t -i -w /mnt/studentfiles/2024/2024MBI02/ --name annotate nextgenusfs/funannotate
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c00f371010d4 nextgenusfs/funannotate "/bin/bash -c funann…" 12 seconds ago Created annotate
docker start annotate
However, the container does not have a process that expected to be running in the background, and it immediately exits after it's started;
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c00f371010d4 nextgenusfs/funannotate "/bin/bash -c funann…" About a minute ago Exited (1) 3 seconds ago annotate
And reading the container's logs show that it indeed expects it to be run interactively, not "detached" (in the background);
docker logs annotate
Usage: funannotate <command> <arguments>
version: 1.8.17
Description: Funannotate is a genome prediction, annotation, and comparison pipeline.
Commands:
clean Find/remove small repetitive contigs
sort Sort by size and rename contig headers
mask Repeatmask genome assembly
...
Perhaps your intent was to run the container interactively, or to start it with a specific command? It looks like the container defaults to us funannotate
as entrypoint, so in that case you may have to override the command to use a shell instead (e.g. bash
);
# remove the old annotate container again
docker rm annotate
# run the container with "bash" as command. you can run "funannotate" inside the container;
docker run -t -i -w /mnt/studentfiles/2024/2024MBI02/ --name annotate nextgenusfs/funannotate bash
root@00dd43d4d500:/mnt/studentfiles/2024/2024MBI02# funannotate --version
funannotate v1.8.17
I don't think there's a bug at hand here, so I'll close this ticket, but feel free to continue the conversation
Perhaps your intent was to run the container interactively, or to start it with a specific command? It looks like the container defaults to us
funannotate
as entrypoint, so in that case you may have to override the command to use a shell instead (e.g.bash
);# remove the old annotate container again docker rm annotate # run the container with "bash" as command. you can run "funannotate" inside the container; docker run -t -i -w /mnt/studentfiles/2024/2024MBI02/ --name annotate nextgenusfs/funannotate bash root@00dd43d4d500:/mnt/studentfiles/2024/2024MBI02# funannotate --version funannotate v1.8.17
Hi, thank you so much for everything! I tried to run the image directly and this worked for some commands, however, for many commands docker cannot access my directories I need for input for the commands.. hence why I thought to make a container and mount the directories to it. Will that work or would you suggest another way or reason for the input issue for some directories?
Description
Unfortunately I do not have an extensive way to reproduce this error as I am sure it will work fine for almost all of you. I have downloaded and created a docker image, it shows up in the list after running docker image ls. When running create as follows:
docker create -t -i -w /mnt/studentfiles/2024/2024MBI02/ nextgenusfs/funannotate --name annotate
I get the following output:
a6ab4e711e5c2c159957900d33b3754dcebef37c99d57680a804d06698dee931
Which I assume is the container tag. However, running docker container ls shows an empty list and trying to use the exec or start command also gives:
Error response from daemon: No such container: annotate
Why can I not see my container after creating it? Or maybe differently, why is my container not being created? I need to create a container for docker to be able to see my input and output directories so I am stuck here. If anybody knows a possible fix I would greatly appreciate it.
Reproduce
docker create -t -i -w /mnt/studentfiles/2024/2024MBI02/ nextgenusfs/funannotate --name annotate docker start or exec, or container ls
Expected behavior
Make a new container that shows up in the list
docker version
docker info
Additional Info
No response