2019-04-21 18:43:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -ve
|
|
|
|
|
|
|
|
apk add -q -f curl libc6-compat tzdata
|
2020-03-02 16:38:07 +00:00
|
|
|
download_go
|
2019-04-21 18:43:04 +00:00
|
|
|
# ---
|
|
|
|
cat <<EOF >/etc/profile.d/build.sh
|
2020-02-28 22:39:11 +00:00
|
|
|
export SELINUX=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
|
|
|
# ---
|
|
|
|
. /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
|
2020-05-05 23:26:05 +00:00
|
|
|
)
|