View Issue Details

IDProjectCategoryView StatusLast Update
0015320CentOS-7dockerpublic2018-12-11 09:28
Reporterxdmitry 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86_64OSCentosOS Version7.5.1804
Product Version7.5.1804 
Target VersionFixed in Version 
Summary0015320: docker run --init doesn't work
DescriptionWhen you start container with --init flag, you get "exec -- failed: No such file or directory" error message and container won't start.

For instance, let's run alpine with --init:
# docker run -u root -it --rm --init alpine uname; docker version -f '{{ .Server.Version }}'
exec -- failed: No such file or directory
1.13.1

Same works fine without --init flag:
# docker run -u root -it --rm alpine uname
Linux

Also if we get latest official docker-1.13.1, this works too:
# service docker stop; yum -q -y remove `rpm -qa|grep ^docker` ; yum -q -y install docker-engine ; service docker start
Redirecting to /bin/systemctl stop docker.service
warning: /etc/sysconfig/docker-storage saved as /etc/sysconfig/docker-storage.rpmsave
Redirecting to /bin/systemctl start docker.service

# docker run -u root -it --rm --init alpine uname; docker version -f '{{ .Server.Version }}'
Linux
1.13.1-cs9

Looks like this issue is present in RedHat too, as someone have reported similar issue at https://access.redhat.com/discussions/3317071
Steps To Reproduce# docker run -u root -it --rm --init alpine uname

(results in exec -- failed: No such file or directory)
TagsNo tags attached.
abrt_hash
URL

Activities

xdmitry

xdmitry

2018-09-25 15:57

reporter   ~0032788

Just discovered that "1.13.1-cs9" version is mentioned above, which comes with many fixes from 17.x, so it may work differently.

Thus, I've tried to reproduce this issue with "original" docker 1.13.1 and got same results, which means that there is some bug in CentOS/RedHat version rather than it was fixed in 1.13.1-cs9:

# yum install -q -y https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.13.1-1.el7.centos.x86_64.rpm
# service docker start
# docker run -u root -it --rm --init alpine uname; docker version
Linux
Client:
 Version: 1.13.1
 API version: 1.26
 Go version: go1.7.5
 Git commit: 092cba3
 Built: Wed Feb 8 06:38:28 2017
 OS/Arch: linux/amd64

Server:
 Version: 1.13.1
 API version: 1.26 (minimum version 1.12)
 Go version: go1.7.5
 Git commit: 092cba3
 Built: Wed Feb 8 06:38:28 2017
 OS/Arch: linux/amd64
 Experimental: false
xdmitry

xdmitry

2018-09-25 17:11

reporter   ~0032789

what I've discovered is that replacing /usr/libexec/docker/docker-init-current with one from https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.13.1-1.el7.centos.x86_64.rpm fixes things, so looks like there is some issue with bundled tini version
xdmitry

xdmitry

2018-09-26 06:29

reporter   ~0032795

looking further into the matter I've identified that issue is that minimal version of tini is built in spec file:

# build docker-init
pushd tini-%{commit_tini}
cmake -DMINIMAL=ON .
sed -i 's/#define TINI_GIT ""/#define TINI_GIT " - git.%{commit_tini}"/g' tiniConfig.h
make tini-static
popd

if we change "cmake -DMINIMAL=ON ." to "cmake ." then good version of tini is built and docker --init starts to work.

Could you please adjust that setting in docker.spec and rebuild package?
xdmitry

xdmitry

2018-09-27 13:21

reporter   ~0032811

it looks like this one was already reported to RedHat as https://bugzilla.redhat.com/show_bug.cgi?id=1615788
xdmitry

xdmitry

2018-11-26 09:59

reporter   ~0033143

this was fixed in upstream, hope this change will reach CentOS users soon
tigalch

tigalch

2018-11-26 10:08

manager   ~0033144

I don't see an update errata in that RH bugzilla entry. So, once RH releases that update, CentOS will inherit the fix.
xdmitry

xdmitry

2018-12-11 09:28

reporter   ~0033309

docker-1.13.1-88.git07f3374.el7.centos.x86_64 has been released, and contains fix for this issue

Issue History

Date Modified Username Field Change
2018-09-25 15:26 xdmitry New Issue
2018-09-25 15:57 xdmitry Note Added: 0032788
2018-09-25 17:11 xdmitry Note Added: 0032789
2018-09-26 06:29 xdmitry Note Added: 0032795
2018-09-26 06:59 arrfab Note Added: 0032796
2018-09-27 13:21 xdmitry Note Added: 0032811
2018-11-26 09:59 xdmitry Note Added: 0033143
2018-11-26 10:08 tigalch Note Added: 0033144
2018-12-11 09:28 xdmitry Note Added: 0033309