Skip to content

new images fails with Permission denied #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yaitskov opened this issue Jun 24, 2016 · 6 comments
Closed

new images fails with Permission denied #616

yaitskov opened this issue Jun 24, 2016 · 6 comments

Comments

@yaitskov
Copy link

Hi,

I use mysql:5.6 image. Yesterday after rebuilding db image the container fails to start with error

docker logs bbaaf7335e96
/usr/local/bin/docker-entrypoint.sh: line 21: /dev/null: Permission denied

I use

docker --version
Docker version 1.11.1, build 5604cbe

I didn't updated docker but noticed that docker-entrypoint.sh is different from the working image.

docker inspect 64792228c966
[
    {
        "Id": "sha256:64792228c966ab0e63f247490f8a177399c08f13278f2f90c90572323931e231",
        "RepoTags": [
            test/platform-mysql:5.6"
        ],
        "RepoDigests": [],
        "Parent": "",
        "Comment": "",
        "Created": "2016-06-23T10:40:28.896245273Z",
        "Container": "f26314b93831ca2640007b18f14b1458051186cbd882eb536b790a4ea39d4245",
        "ContainerConfig": {
            "Hostname": "b0cf605c7757",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "3306/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "GOSU_VERSION=1.7",
                "MYSQL_MAJOR=5.6",
                "MYSQL_VERSION=5.6.30-1debian8",
                "MYSQL_ROOT_PASSWORD=root"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ENV MYSQL_ROOT_PASSWORD=root"
            ],
            "Image": "sha256:2c0964ec182ae9a045f866bbc2553087f6e42bfc16074a74fb820af235f070ec",
            "Volumes": {
                "/var/lib/mysql": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "DockerVersion": "1.11.2",
        "Author": "",
        "Config": {
            "Hostname": "b0cf605c7757",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "3306/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "GOSU_VERSION=1.7",
                "MYSQL_MAJOR=5.6",
                "MYSQL_VERSION=5.6.30-1debian8",
                "MYSQL_ROOT_PASSWORD=root"
            ],
            "Cmd": [
                "mysqld"
            ],
            "Image": "sha256:2c0964ec182ae9a045f866bbc2553087f6e42bfc16074a74fb820af235f070ec",
            "Volumes": {
                "/var/lib/mysql": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 329012570,
        "VirtualSize": 329012570,
        "GraphDriver": {
            "Name": "aufs",
            "Data": null
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:4dcab49015d47e8f300ec33400a02cebc7b54cadd09c37e49eccbc655279da90",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:47bce276c5783a6cfc88e0ac368af70909144d04780222d134090dbf08f897aa",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:093c117bc4d3e1cd6e597a89b1648ebb3543be581c61aba80fc41ff6f7ae8e6d",
                "sha256:1028156f10f1a0f79dba5be05e935d5f4588ebe7c25a3581843f7a759a2d7bfb",
                "sha256:7824db6f3dbba273b11cf7c9633284f2fe62a39e984813e3a646337757dfa128",
                "sha256:97dbcadd30ffc35411bd734602a42af340e9b891f3be5f6ca6197d84ffc60c30",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:0f00d4bfc4743cdc3c693138c145ac713d22b710f4285a61eb2cd304769a4826",
                "sha256:ceff8ad209270e8dc75809ae1fd9fc412c9acba707e3f5bf42a3c9175564cfe3",
                "sha256:c5d25ce0051d58f330cf8369a2022ceecd693108020fce028de6b1933091fc9f",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:ed9e4482e66dafe09ba0559802b91f19eb68e7da505400eadb79777b1ce9acaf",
                "sha256:b4002c87c5693f4545efd845419c7a271e417ea479d9cf23366991a31c898194",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
            ]
        }
    }
]
@yosifkit
Copy link
Member

What does your docker run look like?

@broth-eu
Copy link

I'm having the same issue with this image. It occurs with all mariadb images as well. However, other images (e.g. the one for Neo4j) work without any problems.
I simply try to start the container using following command: docker run mysql

@kowalk
Copy link

kowalk commented Jul 28, 2016

Same here:
mysql_1 | /usr/local/bin/docker-entrypoint.sh: line 21: /dev/null: Permission denied

@yosifkit
Copy link
Member

Can you give any extra info? docker version, docker info, docker-compose.yml contents or docker run line?

@dcardosods
Copy link

I'm having the same problem.

docker --version:
Docker version 1.11.0, build 4dc5990

docker info:

Containers: 8
 Running: 0
 Paused: 0
 Stopped: 8
Images: 208
Server Version: 1.12.0
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 194
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: host overlay null bridge
Kernel Version: 4.4.16-boot2docker
Operating System: Boot2Docker 1.12.0 (TCL 7.2); HEAD : e030bab - Fri Jul 29 00:29:14 UTC 2016
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 2.483 GiB
Name: default
ID: Z3BW:Q3R6:NF7E:CMA5:ZBEH:EMQI:KO74:EGH5:SELJ:R35B:DWRD:KGSI
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug mode (client): false
Debug mode (server): true
 File Descriptors: 14
 Goroutines: 24
 System Time: 2016-08-22T19:09:06.712450049Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Labels:
 provider=virtualbox

My docker-compose.yml:

version: '2'
services:
  db:
    image: mysql:5.7
    volumes:
      - "./.data/db:/var/lib/mysql"
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: wordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    volumes:
      - "./src:/usr/src/wordpress/wp-content/themes/COGR"
    links:
      - db
    ports:
      - "8000:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_NAME: wordpress
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress

@yosifkit
Copy link
Member

@dcardosods, I would venture to guess that mysql is failing for you? Have you tried to tell it to run as a different user? Something like MariaDB/mariadb-docker#58 (comment)? So that it runs as the owner of the ./.data/db directory from the host that is shared through VirtualBox shared folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants