2019-04-21 18:43:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -ve
|
|
|
|
|
|
|
|
apk add -q -f curl libc6-compat tzdata
|
2020-02-28 22:39:11 +00:00
|
|
|
echo "Installing go $goversion"
|
2019-04-21 18:43:04 +00:00
|
|
|
curl -sL https://storage.googleapis.com/golang/go${goversion}.linux-${ARCH}.tar.gz | tar -xzf - -C /usr/local
|
|
|
|
# ---
|
|
|
|
cat <<EOF >/etc/profile.d/build.sh
|
2020-02-28 22:39:11 +00:00
|
|
|
export SELINUX=true
|
|
|
|
export DQLITE=true
|
2019-04-21 18:43:04 +00:00
|
|
|
export STATIC_BUILD=true
|
|
|
|
EOF
|
2020-02-28 22:39:11 +00:00
|
|
|
. /etc/profile.d/build.sh
|
2019-04-21 18:43:04 +00:00
|
|
|
# ---
|
2020-02-28 22:39:11 +00:00
|
|
|
echo "Downloading DQLITE from $DQLITE_URL"
|
|
|
|
curl -sfL $DQLITE_URL -o /usr/src/dqlite.tgz
|
|
|
|
# ---
|
2019-04-21 18:43:04 +00:00
|
|
|
. /tmp/docker-run
|
2020-02-28 22:39:11 +00:00
|
|
|
# ---
|
|
|
|
go get -u github.com/go-delve/delve/cmd/dlv
|
2019-04-21 18:43:04 +00:00
|
|
|
# ---
|
|
|
|
cat <<EOF >/etc/profile.d/docker.sh
|
|
|
|
export DOCKER_HOST=tcp://10.0.2.2:2375
|
|
|
|
EOF
|
|
|
|
. /etc/profile.d/docker.sh
|
|
|
|
# ---
|
2020-02-28 23:51:19 +00:00
|
|
|
(
|
|
|
|
if ! docker version --format '{{.Server.Version}}' >/tmp/docker-server-version; then
|
|
|
|
echo "WARNING: Unable to connect to the docker socket, to enable docker in vagrant run the following command on the host:"
|
|
|
|
echo "docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:2375:2375 alpine/socat TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock"
|
|
|
|
else
|
|
|
|
echo "Using host docker server v$(cat /tmp/docker-server-version)"
|
|
|
|
fi
|
|
|
|
)
|