Docker container returns "unknown" for "uname -p" command
I just installed a brand new Ubuntu Server 14.04.2 LTS and also installed docker to run containers. I ran into some problems. The container will be used to run Jenkins and some of its jobs run scripts to install the Android NDK / SDK. These scripts check the platform of the current computer using the command uname -p
. This command works well on the host machine, but returns unknown
in containers like this:
lemonade@olympus:/$ docker info
Containers: 14
Images: 171
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Dirs: 199
Execution Driver: native-0.2
Kernel Version: 3.16.0-38-generic
WARNING: No swap limit support
lemonade@olympus:/$ uname -a
Linux olympus 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
lemonade@olympus:/$ uname -p
x86_64
lemonade@olympus:/$ docker run -ti java:7 /bin/bash
root@c6cdbb8a64fb:/# uname -p
unknown
root@c6cdbb8a64fb:/# uname -a
Linux c6cdbb8a64fb 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 GNU/Linux
Does anyone know why containers are returning this? Some scripts (which are not coded by us) use this, as well as many makefiles.
Thank!
source to share
I don't know the exact reason why the docker image uname -p
is failing java:7
, but it looks like it has to do with the docker image debian
. The docker image ubuntu
is fine.
$ docker run debian uname -p unknown $ docker run ubuntu uname -p x86_64
If you look at the Dockerfile dependencies for the docker image java:7
, you find out the following: java:7
→ buildpack-deps:jessie-scm
→ buildpack-deps:jessie-curl
→debian:jessie
The only thing that breaks uname -p
is addiction debian:jessie
. What you can do is create your own java:7
docker image , but depend on ubuntu
instead debian
.
To do this, you will have to come up with a Dockerfile that is a merge of the ones used to create the image java:7
.
source to share