How to Create a Docker Container from an Image

I have the following image:

REPOSITORY               TAG         IMAGE ID       CREATED       SIZE
   18.04-py3   c3555fec4fe6   3 years ago   5.9GB
The goal is to use Ubuntu 18.04 with CUDA 10.2. 

Now I want to create a container with this image. These are the commands I've tried:

docker image tag pytorch

docker run pytorch

But this is the error:

docker: Error response from daemon: 
mkdir /var/lib/docker/containers/22346b8352726ee06780791c3ee37c138b8c4b3d600225502266916e57902c56: 
no such file or directory.
2

1 Answer

For tag the image clone and run that try this:

List the images

# docker images
REPOSITORY                           TAG       IMAGE ID       CREATED         
SIZE
jupyter/datascience-notebook         latest    f5573d8505f2   4 months ago    4.14GB
centos                               latest    5d0da3dc9764   6 months ago    231MB

Tag your image and check the new clone

[root@local ~]# docker tag centos:latest centos_1:clone
[root@local ~]# docker images
REPOSITORY                           TAG       IMAGE ID       CREATED         SIZE
jupyter/datascience-notebook         latest    f5573d8505f2   4 months ago    4.14GB
centos                               latest    5d0da3dc9764   6 months ago    231MB
centos_1                             clone     5d0da3dc9764   6 months ago    231MB

Run the clone image as a container

[root@local ~]# docker run -it 5d0da3dc9764 bash
[root@99d655eb9ef0 /]#

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest