Skip to content

Commit

Permalink
Dockerize ./scripts/build
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Mar 18, 2015
1 parent 2d0f868 commit 4d957a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
23 changes: 17 additions & 6 deletions scripts/build
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
#!/bin/bash -e

if [[ ! -x "$(which go)" && -x /usr/local/go/bin/go ]]; then
PATH=/usr/local/go/bin:${PATH}
fi
set -x

cd $(dirname $0)/..

if [ -f ./build/bootstrap.envs ];then
. ./build/bootstrap.envs
if [ "$IN_DOCKER" != "true" ]; then
cat > .dockerfile << "EOF"
FROM rancher/dind:v0.1.0
COPY ./scripts/bootstrap /scripts/bootstrap
RUN /scripts/bootstrap
WORKDIR /source
ENV IN_DOCKER true
EOF

docker build -t rancher-os-go-build -f .dockerfile .
docker run --rm -v $(pwd):/source -it rancher-os-go-build ./scripts/build
exit 0
fi

if [[ ! -x "$(which go)" && -x /usr/local/go/bin/go ]]; then
PATH=/usr/local/go/bin:${PATH}
fi

if [ -z "$ROS_CUSTOM_GOPATH" ]; then
Expand Down
1 change: 1 addition & 0 deletions scripts/build-common
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ write_base()
cat > ${DOCKER_FILE} << EOF
FROM ${DOCKER_BASE:=ubuntu:14.04.2}
ENV TERM xterm
ENV IN_DOCKER true
WORKDIR /source
CMD ["/source/scripts/install"]
EOF
Expand Down

0 comments on commit 4d957a9

Please sign in to comment.