thockin/go-build-template

make all-container failure

damianoneill opened this issue · 1 comments

When building all containers on a OSX host

$ make all-container
building: bin/amd64/myapp
Sending build context to Docker daemon  7.117MB
Step 1/5 : FROM alpine
 ---> 76da55c8019d
Step 2/5 : MAINTAINER Tim Hockin <thockin@google.com>
 ---> Using cache
 ---> a48cba04c826
Step 3/5 : ADD bin/amd64/myapp /myapp
 ---> Using cache
 ---> 98797f6223ad
Step 4/5 : USER nobody:nobody
 ---> Using cache
 ---> df8607d69675
Step 5/5 : ENTRYPOINT /myapp
 ---> Using cache
 ---> 0a02c9f41938
Successfully built 0a02c9f41938
Successfully tagged thockin/myapp-amd64:1101a1d
container: thockin/myapp-amd64:1101a1d
building: bin/arm/myapp
Sending build context to Docker daemon  13.56MB
Step 1/5 : FROM armel/busybox
 ---> 7ab410cdaa53
Step 2/5 : MAINTAINER Tim Hockin <thockin@google.com>
 ---> Using cache
 ---> 122edf1d71f5
Step 3/5 : ADD bin/arm/myapp /myapp
ADD failed: stat /var/lib/docker/tmp/docker-builder309680552/bin/arm/myapp: no such file or directory
make[1]: *** [.container-thockin_myapp-arm-1101a1d] Error 1
make: *** [container-arm] Error 2

Generated binaries:

$ tree bin
bin
├── amd64
│   ├── darwin_amd64
│   └── myapp
└── arm
    ├── darwin_arm
    └── linux_arm
        └── myapp

Notice the non amd64 architecture options have an additional level of indirection where the binary is stored.

The Dockerfile template expects ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN

non amd64 generation is bin/ARG_ARCH/OS_ARCH/ARG_BIN note the OS_ARCH folder

should be fixed in master, forgot to close this