Bug 1129770

Summary: docker build using second form of RUN: invalid environment ''
Product: Red Hat Enterprise Linux 7 Reporter: Chris Evich <cevich>
Component: dockerAssignee: William Henry <whenry>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.0CC: dwalsh
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-24 20:14:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
Context directory + files needed to reproduce none

Description Chris Evich 2014-08-13 15:36:01 UTC
Description of problem:
When building from custom Docker file based on completely empty base-image, command using second-form of RUN fails with invalid environment '' error.

Version-Release number of selected component (if applicable):
# docker version
Client version: 1.1.2
Client API version: 1.14
Go version (client): go1.2.2
Git commit (client): 8aa40e8/1.1.2
OS/Arch (client): linux/amd64
Server version: 1.1.2
Server API version: 1.14
Go version (server): go1.2.2
Git commit (server): 8aa40e8/1.1.2
# rpm -q docker

How reproducible:
Slightly complex

Steps to Reproduce:
1. # mkdir empty && cd empty
2. # tar c . | docker import - empty_base_image
3. # docker -D build --no-cache --rm -t test:test .

Actual results:
Sending build context to Docker daemon 1.009 MB
Sending build context to Docker daemon 
Step 0 : FROM empty_base_image
 ---> 0d1221e75ed3
Step 1 : MAINTAINER cevich@redhat.com
 ---> Running in 3e93750f8a58
 ---> a45ba864b27f
Removing intermediate container 3e93750f8a58
Step 2 : ADD basic_tree.tar /
 ---> 23411aaba4c5
Removing intermediate container 484e221185bd
Step 3 : ADD basic_devices.tar /
 ---> f20035818bb7
Removing intermediate container be4b399fd1b4
Step 4 : ENV PATH /usr/sbin:/usr/bin
 ---> Running in cb4c9e121845
 ---> 0fb9681eb8ed
Removing intermediate container cb4c9e121845
Step 5 : ADD busybox /usr/sbin/
 ---> ed6961f64833
Removing intermediate container 9b29c55ea5c2
Step 6 : RUN ["/usr/sbin/busybox", "sh", "-c", "for item in $(busybox --list-full); do busybox ln -s /usr/sbin/busybox $item; done"]
 ---> Running in 6b965167edfa
2014/08/13 11:25:41 invalid environment ''
2014/08/13 11:25:42 no such process

Expected results:
Step 6 success.

Additional info:
Contents of directory the build ran from will be attached...

Comment 1 Chris Evich 2014-08-13 15:40:30 UTC
Created attachment 926498 [details]
Context directory + files needed to reproduce

Included busybox executable in tarball attachment came from http://www.busybox.net/downloads/binaries/latest/busybox-x86_64

Comment 3 Daniel Walsh 2014-09-15 15:49:47 UTC
Could this be a problem with pathing?  If you fully path all busybox in your example does it work?

Comment 4 Chris Evich 2014-09-16 17:38:35 UTC
It's possible, strangely I've seen this problem come and go but have lost track of when/where.  We do set up PATH as part of the dockerfile, but I'll double check and give what you suggest a try...

...nope, of course now it's working perfectly for me w/o changing anything :(

# rpm -q docker
# docker version
Client version: 1.2.0
Client API version: 1.15
Go version (client): go1.3.1
Git commit (client): dc45aa1/1.2.0
OS/Arch (client): linux/amd64
Server version: 1.2.0
Server API version: 1.15
Go version (server): go1.3.1
Git commit (server): dc45aa1/1.2.0

Command: /usr/bin/docker -D build --rm -t buildtest_a0kd_:test /usr/local/autotest/client/tmp/build/src/full
Timeout: 120.0
Executed: 1
Duration: 7.32282400131
Exit code: 0
Standard Out: """Step 0 : FROM empty_base_image
 ---> 6feccfec4d33
Step 1 : MAINTAINER cevich@redhat.com
 ---> Running in 248e11fd5142
 ---> 56279825ed82
Removing intermediate container 248e11fd5142
Step 2 : ADD basic_tree.tar /
 ---> 80e9ec2f60f1
Removing intermediate container 22352f7505d6
Step 3 : ADD basic_devices.tar /
 ---> df8ac1a40583
Removing intermediate container a26725469616
Step 4 : ENV PATH /usr/sbin:/usr/bin
 ---> Running in 88c2f0b032d8
 ---> 8eb1fd093ff4
Removing intermediate container 88c2f0b032d8
Step 5 : ADD busybox /usr/sbin/
 ---> b30f3fd97e84
Removing intermediate container f5390220f6a7
Step 6 : RUN /usr/sbin/busybox sh -c for item in $(busybox --list-full); do busybox ln -s /usr/sbin/busybox $item; done
 ---> Running in c9b5d10d0f0a
 ---> 721b501d2341
Removing intermediate container c9b5d10d0f0a
Successfully built 721b501d2341
Standard Error: """
Sending build context to Docker daemon 1.008 MBker daemon 557.1 kB
Sending build context to Docker daemon 

I think for now, let's just lower the severity/priority of this BZ until/if we can find a way to more reliably reproduce it in the next few weeks.  It's quite possible the underlying problem has been fixed and we can just close.

Comment 5 Daniel Walsh 2014-10-24 20:14:05 UTC
Its been awhile I am going to close.

Comment 6 Chris Evich 2014-10-24 20:18:20 UTC
Oh thanks, I forgot about this one.  It was happening with a lot more frequency when I opened this, now for sure it's not.  I have seen it happen only once or twice since 1.2.0, but still no clue how to repro. it reliably.  It's probably just a fluke.