corso/build/build.sh
Vaibhav Kamra 0707d00ab5
Add a Dockerfile for corso (#247)
Adds a Dockerfile under the docker to package the corso binary.

This currently requires the user to build the corso binary (for linux/amd64) in the build image
prior to building the docker image. Follow up PRs will introduce a Makefile.

Also moves the build image to the build folder and adds a couple of README.md files with
instructions.

Fixes #218
2022-06-28 12:15:30 -07:00

28 lines
575 B
Bash
Executable File

#! /bin/bash
# Builds a docker image that contains the deps for the current version of the
# code. Image expects dev directory to be mounted in the container at runtime.
source paths.sh
BASE_TAG="alcionai/base-dev"
buildImage() {
docker build \
-f Dockerfile \
-t "$BASE_TAG" \
--build-arg uid=$(id -u) \
--build-arg gid=$(id -g) \
.
docker run \
-v "$REPO_CODE":"$GOLANG_REPO_PATH" \
--name build-tmp \
-w "$GOLANG_REPO_PATH" \
-it \
"$BASE_TAG" go get
docker commit build-tmp "$DEV_TAG"
docker rm build-tmp
}
buildImage