2

I have installed a docker on my ubuntu system version 18.04(LTS). However, when I run command for creating simple Hellow-world container from an inbuilt image, I got the following errors

The command I used: sudo docker run docker/whalesay cowsay Hello-World!

The error I got: Unable to find image 'docker/whalesay: latest' locally

Also after waiting for a minute it automatically starts to create a container but after a while again faces timeout error.

latest: Pulling from docker/whalesay Image 
docker.io/docker/whalesay:latest uses outdated schema1 manifest format. 
Please upgrade to a schema2 image for better future compatibility. More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/ 
e190868d63f8: Downloading  5.897MB/65.77MB 909cd34c6fd7: Download complete  
0b9bfabab7c1: Download complete  a3ed95caeb02: Download complete  
00bf65475aba: Downloading  6.212MB/37.71MB c57b6bcc83e3: Download complete  
8978f6879e2f: Downloading  8eed3712d2cf: Waiting  docker: net/http: request canceled (Client.Timeout exceeded while awaiting headers). See 'docker run --help'.

I don't know where I can correct it

2
  • Have you created this image in your host? It looks Commented Aug 9, 2020 at 9:55
  • Please, mark as solved if it worked, not just vote up, please :) Commented Aug 9, 2020 at 11:47

3 Answers 3

1

First, Unable to find image 'docker/whalesay:latest' locally is said when you doesn't specify a tag

A docker image is defined by repo/name:tag

After that, as you can read in https://docs.docker.com/registry/spec/deprecated-schema-v1/, you're downloading an image generated with docker schema v1 (It was generated with a deprecated version of docker), and your docker version uses schema-v2.

So, one possibility should be install a docker previous version which uses schema-v1, but it's not recommended, since it'd worked with deprecated schema images only.

The other possibility is generate image by yourself, using Dockerfile before your docker run command.

Dockerfile https://hub.docker.com/r/docker/whalesay/

FROM ubuntu:14.04

# install cowsay, and move the "default.cow" out of the way so we can overwrite it with "docker.cow"
RUN apt-get update && apt-get install -y cowsay --no-install-recommends && rm -rf /var/lib/apt/lists/* \
    && mv /usr/share/cowsay/cows/default.cow /usr/share/cowsay/cows/orig-default.cow

# "cowsay" installs to /usr/games
ENV PATH $PATH:/usr/games

COPY docker.cow /usr/share/cowsay/cows/
RUN ln -sv /usr/share/cowsay/cows/docker.cow /usr/share/cowsay/cows/default.cow

CMD ["cowsay"]

Put next docker.cow in the same folder than your Dockerfile.

docker.cow

##
## Docker Cow
##
$the_cow = <<EOC;
    $thoughts
     $thoughts
      $thoughts     
                    ##        .            
              ## ## ##       ==            
           ## ## ## ##      ===            
       /""""""""""""""""\___/ ===        
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~   
       \\______ o          __/            
        \\    \\        __/             
          \\____\\______/   
EOC

Finally, execute docker build before your docker run command, and docker image will be generated according to schema-v2.

sudo docker build -t docker/whalesay:latest . 
sudo docker run docker/whalesay cowsay Hello-World!

If you edit another file.cow can create your own whalesay docker image. I've created image with name docker/whalesay:latest in order to use your own command, but you can set whatever name you prefer. It's recommended to use your user docker hub repo (if you have it), because docker push are not allowed for you to docker/whalesay:latest.

Sign up to request clarification or add additional context in comments.

Comments

1

Image docker.io/docker/whalesay:latest uses outdated schema1 manifest format.you're seeing this error because the updated version hasn't been pushed back to DockerHub.

If you just want to test Docker's functionality as a beginner, You can use hello-world Docker image rather than docker/whalesay.

docker run hello-world

Comments

0

You can either

  1. Create your own image
  2. Pull an alternative Image of the one you want to pull it Use can user this one:

docker pull chuanwen/cowsay

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.