Skip to content

Commit

Permalink
fix prereq install for golang effecting docker build (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmwample authored Aug 17, 2023
1 parent 77a85af commit 815a746
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ COPY cmd/ /opt/conjure/cmd
COPY pkg/ /opt/conjure/pkg
COPY proto/ /opt/conjure/proto

RUN PATH="$HOME/.go/bin/:$PATH" make app
RUN PATH="$HOME/.go/bin/:$PATH" make registration-server
RUN PATH="$HOME/.go/bin/:/usr/local/go/bin:$PATH" make app
RUN PATH="$HOME/.go/bin/:/usr/local/go/bin:$PATH" make registration-server

# Add default configs and launch scripts
COPY sysconfig/conjure.conf /opt/conjure/sysconfig/
Expand Down
18 changes: 15 additions & 3 deletions prereqs_once.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,20 @@ install_go() {
# INSTALL GOLANG

if ! command -v go &> /dev/null; then
echo "unable to find golang, installing latest."
curl -LO https://get.golang.org/$(uname)/go_installer && chmod +x go_installer && ./go_installer && rm go_installer
GOLANG_LATEST_STABLE_VERSION=$(curl "https://go.dev/dl/?mode=json" | jq -r '.[0].files[].filename | select(test("go.*.linux-amd64.tar.gz"))')
echo "unable to find golang, installing latest. ${GOLANG_LATEST_STABLE_VERSION}"
curl -OL https://go.dev/dl/${GOLANG_LATEST_STABLE_VERSION}
if [ $? -ne 0 ]; then
echo "$0: pulling golang latest stable failed"
exit 1
fi
tar -C /usr/local -xzf ${GOLANG_LATEST_STABLE_VERSION}
export PATH=$PATH:/usr/local/go/bin
if ! command -v go &> /dev/null; then
echo "$0: failed to install golang"
exit 1
fi
go version
fi
}

Expand Down Expand Up @@ -157,7 +169,7 @@ install_routes() {
echo "Installing install, libssl, git, cargo..."
sudo apt-get update -y
# FIXME: Hold back kernel and kernel headers?
sudo apt-get install -y libssl-dev git libgmp3-dev wget lsb-release build-essential
sudo apt-get install -y libssl-dev git libgmp3-dev wget lsb-release build-essential jq

install_deps

Expand Down

0 comments on commit 815a746

Please sign in to comment.