简体   繁体   中英

docker run hello-world fails, stderr: permission denied

I have installed docker via https://get.docker.com/ and the process went fine but when I try to run it I'm receiving the error

docker: failed to register layer: ApplyLayer exit status 1 stdout: stderr: permission denied.

lsb_release -a:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:    16.04
Codename:   xenial

uname -a

Linux stage 4.15.18-1-pve #1 SMP PVE 4.15.18-16 (Mon, 23 Jul 2018 15:59:19 +0200) x86_64 x86_64 x86_64 GNU/Linux

docker version:

Client:
 Version:           18.09.3
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        774a1f4
 Built:             Thu Feb 28 06:40:58 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.3
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       774a1f4
  Built:            Thu Feb 28 05:59:55 2019
  OS/Arch:          linux/amd64
  Experimental:     false

docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 18.09.3
Storage Driver: vfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: e6b3f5632f50dbc4e9cb6288d911bf4f5e95b18e
runc version: 6635b4f0c6af3810594d2770f662f34ddc15b40d
init version: fec3683
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.15.18-1-pve
Operating System: Ubuntu 16.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 16GiB
Name: stage
ID: QFBZ:LSOW:2QT3:XGVI:4MIH:5BM7:7XR6:YKC7:JOMO:OWUW:T6YT:KVMA
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

docker -D run hello-world:

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Extracting [==================================================>]     977B/977B
docker: failed to register layer: ApplyLayer exit status 1 stdout:  stderr: permission denied.
See 'docker run --help'.

I don't have /etc/pve/lxc folder nor lxc command available as docker run hello-world still fails, permission denied seems to suggest to resolve it.

I'm losing my mind around this error, please help!

You're maybe missing this step

sudo usermod -aG docker your-user

And pay attention to this:

NOTE: Remember to log out and back in for this to take effect!

As docker is telling stderr: Permission denied

Is McAfee antivirus running? Specifically the isectpd.service (McAfee Endpoint Security for Linux Threat Prevention).

If so this may cause pull to fail.

Remove/Stop McAfee and retry.

I have the same issue when I try to deploy stack to Docker Swarm through GitLab DinD runner.

- sh deploy.sh
- echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY_IMAGE
- docker context create --docker host=$DEPLOYMENT_SSH_URL --description "Remote GitLab connection"  remote-gitlab
- docker context use remote-gitlab
- docker stack deploy --compose-file docker-stack.yml LevelUp

deploy.sh code

#!/bin/bash

which ssh-agent || apk add --no-cache openssh-client
which curl || apk --no-cache add curl

mkdir ~/.ssh/
echo "$KNOWNHOSTS" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | base64 -d | ssh-add -

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM