mirror of
https://github.com/rancher/os.git
synced 2025-07-18 00:51:04 +00:00
Dockerize ./scripts/build
This commit is contained in:
parent
2d0f868a2e
commit
4d957a9f47
@ -1,13 +1,24 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
set -x
|
||||||
if [[ ! -x "$(which go)" && -x /usr/local/go/bin/go ]]; then
|
|
||||||
PATH=/usr/local/go/bin:${PATH}
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd $(dirname $0)/..
|
cd $(dirname $0)/..
|
||||||
|
|
||||||
if [ -f ./build/bootstrap.envs ];then
|
if [ "$IN_DOCKER" != "true" ]; then
|
||||||
. ./build/bootstrap.envs
|
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
|
fi
|
||||||
|
|
||||||
if [ -z "$ROS_CUSTOM_GOPATH" ]; then
|
if [ -z "$ROS_CUSTOM_GOPATH" ]; then
|
||||||
|
@ -52,6 +52,7 @@ write_base()
|
|||||||
cat > ${DOCKER_FILE} << EOF
|
cat > ${DOCKER_FILE} << EOF
|
||||||
FROM ${DOCKER_BASE:=ubuntu:14.04.2}
|
FROM ${DOCKER_BASE:=ubuntu:14.04.2}
|
||||||
ENV TERM xterm
|
ENV TERM xterm
|
||||||
|
ENV IN_DOCKER true
|
||||||
WORKDIR /source
|
WORKDIR /source
|
||||||
CMD ["/source/scripts/install"]
|
CMD ["/source/scripts/install"]
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user