Score:0

The command "docker run hello-world" does not output anything

cd flag

I've updated the question in response to comments below.

Here are the commands to remove, install, test, and display information about docker

Delete docker key

sudo apt-key list Docker
sudo apt-key del "9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88"
sudo apt-key list Docker

Uninstall docker

# sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get remove docker docker.io containerd runc

Comment out docker repository

sudo gedit /etc/apt/sources.list.d/docker.list

sudo more /etc/apt/sources.list.d/docker.list
# deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu   focal stable

Install docker

sudo apt install --reinstall docker.io

Add group

sudo groupadd docker
sudo usermod -aG docker $USER

Docker info

$ docker info

Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 
 runc version: 
 init version: 
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.15.0-53-generic
 Operating System: Ubuntu 20.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 62.5GiB
 Name: cd0254nb032364
 ID: 23TM:HHHH:IE6K:ZS3W:UAQJ:6D4X:OZHT:VCTD:EHT2:YEXJ:EL3J:WLWS
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 31
  Goroutines: 49
  System Time: 2022-11-29T14:03:27.77815013-05:00
  EventsListeners: 0
 HTTP Proxy: xxx
 HTTPS Proxy: xxx
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Docker version

$ docker version

Client:
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.2
 Git commit:        20.10.12-0ubuntu2~20.04.1
 Built:             Wed Apr  6 02:14:38 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.2
  Git commit:       20.10.12-0ubuntu2~20.04.1
  Built:            Thu Feb 10 15:03:35 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.5.9-0ubuntu1~20.04.5
  GitCommit:        
 runc:
  Version:          1.1.0-0ubuntu1~20.04.2
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        

Print date, test docker

john@cd0254nb032364:~$ date
Tue 29 Nov 2022 02:20:46 PM EST

john@cd0254nb032364:~$ docker run --log-driver "syslog" hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Extracting [==================================================>]  2.479kB/2.479kB
^C

Display syslog

Nov 29 14:13:46 cd0254nb032364 dockerd[64419]: time="2022-11-29T14:13:46.399481658-05:00" level=debug msg="found match for linux/amd64 with media type application/vnd.docker.distribution.manifest.v2+json, digest sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4"
Nov 29 14:17:01 cd0254nb032364 CRON[99485]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Nov 29 14:19:33 cd0254nb032364 kernel: [708152.538463] i915 0000:00:02.0: [drm] *ERROR* Atomic update failure on pipe A (start=301608 end=301609) time 117 us, min 1064, max 1079, scanline start 1062, end 1080
Nov 29 14:20:52 cd0254nb032364 dockerd[64419]: time="2022-11-29T14:20:52.955928670-05:00" level=debug msg="Calling HEAD /_ping"
Nov 29 14:20:52 cd0254nb032364 dockerd[64419]: time="2022-11-29T14:20:52.956661084-05:00" level=debug msg="Calling POST /v1.41/containers/create"
Nov 29 14:20:52 cd0254nb032364 dockerd[64419]: time="2022-11-29T14:20:52.956842881-05:00" level=debug msg="form data: {\"AttachStderr\":true,\"AttachStdin\":false,\"AttachStdout\":true,\"Cmd\":null,\"Domainname\":\"\",\"Entrypoint\":null,\"Env\":null,\"HostConfig\":{\"AutoRemove\":false,\"Binds\":null,\"BlkioDeviceReadBps\":null,\"BlkioDeviceReadIOps\":null,\"BlkioDeviceWriteBps\":null,\"BlkioDeviceWriteIOps\":null,\"BlkioWeight\":0,\"BlkioWeightDevice\":[],\"CapAdd\":null,\"CapDrop\":null,\"Cgroup\":\"\",\"CgroupParent\":\"\",\"CgroupnsMode\":\"\",\"ConsoleSize\":[0,0],\"ContainerIDFile\":\"\",\"CpuCount\":0,\"CpuPercent\":0,\"CpuPeriod\":0,\"CpuQuota\":0,\"CpuRealtimePeriod\":0,\"CpuRealtimeRuntime\":0,\"CpuShares\":0,\"CpusetCpus\":\"\",\"CpusetMems\":\"\",\"DeviceCgroupRules\":null,\"DeviceRequests\":null,\"Devices\":[],\"Dns\":[],\"DnsOptions\":[],\"DnsSearch\":[],\"ExtraHosts\":null,\"GroupAdd\":null,\"IOMaximumBandwidth\":0,\"IOMaximumIOps\":0,\"IpcMode\":\"\",\"Isolation\":\"\",\"KernelMemory\":0,\"KernelMemoryTCP\":0,\"Links\":null,\"LogConfig\":{\"Config\":{},\"Type\":\"syslog\"},\"MaskedPaths\":null,\"Memory\":0,\"MemoryReservation\":0,\"MemorySwap\":0,\"MemorySwappiness\":-1,\"NanoCpus\":0,\"NetworkMode\":\"default\",\"OomKillDisable\":false,\"OomScoreAdj\":0,\"PidMode\":\"\",\"PidsLimit\":0,\"PortBindings\":{},\"Privileged\":false,\"PublishAllPorts\":false,\"ReadonlyPaths\":null,\"ReadonlyRootfs\":false,\"RestartPolicy\":{\"MaximumRetryCount\":0,\"Name\":\"no\"},\"SecurityOpt\":null,\"ShmSize\":0,\"UTSMode\":\"\",\"Ulimits\":null,\"UsernsMode\":\"\",\"VolumeDriver\":\"\",\"VolumesFrom\":null},\"Hostname\":\"\",\"Image\":\"hello-world\",\"Labels\":{},\"NetworkingConfig\":{\"EndpointsConfig\":{}},\"OnBuild\":null,\"OpenStdin\":false,\"Platform\":null,\"StdinOnce\":false,\"Tty\":false,\"User\":\"\",\"Volumes\":{},\"WorkingDir\":\"\"}"
Nov 29 14:20:52 cd0254nb032364 dockerd[64419]: time="2022-11-29T14:20:52.959206339-05:00" level=debug msg="Calling GET /v1.41/info"
Nov 29 14:20:52 cd0254nb032364 dockerd[64419]: time="2022-11-29T14:20:52.968076485-05:00" level=debug msg="Calling POST /v1.41/images/create?fromImage=hello-world&tag=latest"
Nov 29 14:20:52 cd0254nb032364 dockerd[64419]: time="2022-11-29T14:20:52.976774280-05:00" level=debug msg="Trying to pull hello-world from https://registry-1.docker.io v2"
Nov 29 14:20:53 cd0254nb032364 dockerd[64419]: time="2022-11-29T14:20:53.548021023-05:00" level=debug msg="Pulling ref from V2 registry: hello-world:latest"
Nov 29 14:20:53 cd0254nb032364 dockerd[64419]: time="2022-11-29T14:20:53.548058753-05:00" level=debug msg="docker.io/library/hello-world:latest resolved to a manifestList object with 11 entries; looking for a unknown/amd64 match"
Nov 29 14:20:53 cd0254nb032364 dockerd[64419]: time="2022-11-29T14:20:53.548075219-05:00" level=debug msg="found match for linux/amd64 with media type application/vnd.docker.distribution.manifest.v2+json, digest sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4"
Nov 29 14:21:30 cd0254nb032364 auditmanager: Received wakeup signal before sleep finished

Display docker processes in separate terminal. Note, no processes are displayed.

john@cd0254nb032364:~$ docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
john@cd0254nb032364:~$ 

I don't know if this is helpful, but I tried the command

ohn@cd0254nb032364:~$ docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
405fecb6a2fa: Extracting [==>                                                ]  32.77kB/773kB

And, that command does not seem to pull the image. If I list the images, there are none on the system, including hello-world.

john@cd0254nb032364:~$ docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
john@cd0254nb032364:~$ 

So, maybe the issue is my internet connection, I'm unable to pull the images down. Is there a way to check this? Can the images be pulled manually?

How can I debug, or correct the setup so the docker command hello-world runs?

Artur Meinild avatar
vn flag
What do the log files say? (Probably syslog?)
ru flag
Well, the download for the image wasn't complete, so `ctrl+c` will have killed the process. Have you tried rerunning again? And then waiting a while for it to complete extraction/download? If you don't do that it will never run.
John avatar
cd flag
I've reran it, and waited, but don't see any output. $ docker run --log-driver "syslog" hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 2db29710123e: Extracting 2.479kB/2.479kB
John avatar
cd flag
I don't see anything in syslog related to this. I just reran it after 13:10 and the last entry in syslog (unrelated) is at 13:08. Do I need to add a flag to turn on log saving?
Artur Meinild avatar
vn flag
Please provide the last 30 lines from `/var/log/syslog` after running the command, and also output of `docker ps -a`.
Artur Meinild avatar
vn flag
How did you install Docker - you seem to be missing some vital components.
Artur Meinild avatar
vn flag
When you update, please confirm Docker installation with output of: `docker version`
John avatar
cd flag
I've added remove / install, listed syslog, and listed docker ps -a. I think the information to solve the problem is in the syslog display, but I'm not familiar with the output.
Artur Meinild avatar
vn flag
I think you're right that somehow the problems comes from the fact that you're not able to pull the images. Are you behind a firewall that blocks anything? Do you have enough disk space? Maybe you should rephrase your entire question to focus on that you can't pull Docker images.
Score:0
vn flag

You seem to be missing some vital components. Notice this:

 Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 
 runc version: 
 init version:

On a working system, this should read: (the version numbers are from my Ubuntu 22.04 with Docker 20.10.21 installed from the Docker repos)

 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 1c90a442489720eec95342e1789ee8a5e1b9536f
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0

If you installed Docker from the Ubuntu repos, run: (I don't think many people use this option, but still..)

sudo apt install --reinstall docker.io

If you installed Docker from the Docker repos, run:

sudo apt install --reinstall docker-ce docker-ce-cli containerd.io docker-compose-plugin

Also, remember to add your user to the docker group.

See more info here.

John avatar
cd flag
Thank you for the response. I'll update the original question, but I still get the same error.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.