drydock/tools/baclient_build.sh
Ahmad Mahmoudi 54675558fd Update image build script to run in a docker
Updated Makefile to run the build baclient package for go on the
host instead of as a docker container, to allow the Makefile be
called from another container. Reason being, in a docker-in-docker,
volume mapping requires knowledge of host filesystem path instead
of the docker daemon filesystem path.

Corrected proxy configuration in the scripts to use the USE_PROXY,
PROXY and NO_PROXY environment variables.

Updated Dockerfile to add multi-stage build, to avoid including the
golang-go package in the docker image. Stage one creates the
baclient Go library, and stage two creates the drydock image, and
copies the baclient from stage one image.

Change-Id: I29a30e870da8f44279dcd62bb1173165fa939d43
2020-01-14 17:39:27 -06:00

23 lines
592 B
Bash
Executable File

#!/bin/bash
# Install golang-go package, and build the baclient library
set -x
if $(uname -a | grep -q Ubuntu); then
GOPATH=$1
BUILD_DIR=$2
if [[ ! -f ./baclient_built ]]; then
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get \
-o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold" \
install -y --no-install-recommends golang-go
GOPATH=${GOPATH} go build -o ${BUILD_DIR}/baclient baclient
else
echo "Baclient library is already built. No action."
fi
else
echo "Only support testing on Ubuntu hosts at this time."
fi