Skip to content

Can't run bash/bash-scripts in Docker #141

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
jbaiter opened this issue Jan 4, 2018 · 3 comments
Closed

Can't run bash/bash-scripts in Docker #141

jbaiter opened this issue Jan 4, 2018 · 3 comments

Comments

@jbaiter
Copy link

jbaiter commented Jan 4, 2018

For some reason I no longer seem to be able to run bash scripts or interactive bash sessions in the manylinux_x86_64 container:

$ docker run --rm -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/build-wheels.sh linux
# No output at all
$ docker run -it --rm quay.io/pypa/manylinux1_x86_64 /bin/bash
# No output, again

This does not seem to be a problem with Docker, since interactive sessions and shell scripts work without any problems in other containers.

$ dockerd --version
Docker version 17.12.0-ce, build c97c6d6
$ docker image inspect quay.io/pypa/manylinux1_x86_64
[
    {
        "Id": "sha256:1164b774ebffa6fe2d997978c63a080e0258404683f9f246a3a90824ba539f0f",
        "RepoTags": [
            "quay.io/pypa/manylinux1_x86_64:latest"
        ],
        "RepoDigests": [
            "quay.io/pypa/manylinux1_x86_64@sha256:a2c5464e81ad019943cc2e0f5711c27b893e262617d2485b450c592a73854caa"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2018-01-03T19:52:44.036841698Z",
        "Container": "c5387a7cdb1c0be1ac31fa8d2fe75037b4688b5e7b4aaade5afbe40941c65b73",
        "ContainerConfig": {
            "Hostname": "a64418c62400",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/opt/rh/devtoolset-2/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LC_ALL=en_US.UTF-8",
                "LANG=en_US.UTF-8",
                "LANGUAGE=en_US.UTF-8",
                "LD_LIBRARY_PATH=/opt/rh/devtoolset-2/root/usr/lib64:/opt/rh/devtoolset-2/root/usr/lib:/usr/local/lib64:/usr/local/lib",
                "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig",
                "SSL_CERT_FILE=/opt/_internal/certs.pem"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "CMD [\"/bin/bash\"]"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:af37f45dd6f272d872ac9a1cf5d05aec4f9eefeabbe42b3db995789fe5ddb09a",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": [],
            "Labels": {}
        },
        "DockerVersion": "17.09.0-ce",
        "Author": "The ManyLinux project",
        "Config": {
            "Hostname": "a64418c62400",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/opt/rh/devtoolset-2/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LC_ALL=en_US.UTF-8",
                "LANG=en_US.UTF-8",
                "LANGUAGE=en_US.UTF-8",
                "LD_LIBRARY_PATH=/opt/rh/devtoolset-2/root/usr/lib64:/opt/rh/devtoolset-2/root/usr/lib:/usr/local/lib64:/usr/local/lib",
                "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig",
                "SSL_CERT_FILE=/opt/_internal/certs.pem"
            ],
            "Cmd": [
                "/bin/bash"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:af37f45dd6f272d872ac9a1cf5d05aec4f9eefeabbe42b3db995789fe5ddb09a",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": [],
            "Labels": {}
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 1203139420,
        "VirtualSize": 1203139420,
        "GraphDriver": {
            "Data": {
                "DeviceId": "1197",
                "DeviceName": "docker-254:5-12451843-887680b12017a0563ee0beafb0e5c823ac2a8bb16d214ffffb849de39aaac29b",
                "DeviceSize": "10737418240"
            },
            "Name": "devicemapper"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:8e2d95010a36fc40baf8ea9050f26273c9a7d131c76aa209d834e447b824a5b3",
                "sha256:67afcf3865b377323c581d873687700b0798bfbf4de1e61a39a8c3fcdda6c5d6",
                "sha256:52abdca472d189f4252a2b5ea682822cf13bec63cd1d739363120f9febff950f"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]
@njsmith
Copy link
Member

njsmith commented Jan 4, 2018

Does this explain anything?

https://mail.python.org/pipermail/wheel-builders/2016-December/000239.html

@jbaiter
Copy link
Author

jbaiter commented Jan 5, 2018

Brilliant, thank you, that explains everything!

@Mizux
Copy link

Mizux commented Sep 17, 2018

Sorry to necro post but what is the longterm fix for this one ?
I mean:

reboot and add the option 'vsyscall=emulate' to
the kernel command line

not seems to be a longterm "secure" solution at most a quick workaround IMHO...

PEP571 which follows PEP513 talk about it...
REF: https://www.python.org/dev/peps/pep-0571/#compatibility-with-kernels-that-lack-vsyscall
TLDR:

building manylinux2010 image itself, still requires a host kernel that provides the vsyscall mechanism, but the resulting image can be both run on hosts that provide it and those that do not.

FYI

[^_^]─mizux@mizux %docker run --rm -it centos:5     
Unable to find image 'centos:5' locally
5: Pulling from library/centos
38892065247a: Pull complete 
Digest: sha256:70fffd687ff9545662c30f9043108489c698662861cd5f76070f7e2cd350564f
Status: Downloaded newer image for centos:5
[139]─[/tmp]
[>_<]─mizux@mizux %docker run --rm -it centos:6
Unable to find image 'centos:6' locally
6: Pulling from library/centos
1c8f9aa56c90: Pull complete 
Digest: sha256:b358c4a16ef77db3a07eaaaf62c707f51aa15bca820489392cc9d97046bc483a
Status: Downloaded newer image for centos:6
[139]─[/tmp]
[>_<]─mizux@mizux %docker run --rm -it centos:7
[root@1ff504c5487e /]# /lib64/libc.so.6 
GNU C Library (GNU libc) stable release version 2.17, by Roland McGrath et al.
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.8.5 20150623 (Red Hat 4.8.5-28).
Compiled on a Linux 3.10.0 system on 2018-04-10.
Available extensions:
	The C stubs add-on version 2.1.2.
	crypt add-on version 2.1 by Michael Glad and others
	GNU Libidn by Simon Josefsson
	Native POSIX Threads Library by Ulrich Drepper et al
	BIND-8.2.3-T5B
	RT using linux kernel aio
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

Centos:7 working with a glibc 2.17

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

3 participants