Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add Dockerfile for Go CLI
  • Loading branch information
viktoriia-fomina authored Jun 1, 2023
commit ccdc9ccde9ee64521a3be6f4e95d2b4562748c12
41 changes: 41 additions & 0 deletions utbot-cli-go/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM azul/zulu-openjdk:11.0.15-11.56.19

ARG UTBOT_GO_CLI

WORKDIR /usr/src/

# Install UTBot Go CLI

ARG UTBOT_GO_CLI
ARG CREATE_GO_MODULE_SCRIPT

WORKDIR /usr/src/

COPY ${UTBOT_GO_CLI} .
COPY ${CREATE_GO_MODULE_SCRIPT} .

# Install Go
RUN apt-get update && \
apt-get install -y wget && \
# Install Go
wget https://go.dev/dl/go1.19.linux-amd64.tar.gz && \
tar -xvf go1.19.linux-amd64.tar.gz && \
mv go /usr/local && \
rm go1.19.linux-amd64.tar.gz && \
apt-get clean

# Install gcc
RUN apt-get update \
&& apt-get install -y build-essential \
software-properties-common \
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& apt-get install -y gcc-9 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 \
&& update-alternatives --config gcc \
&& apt-get clean

ENV GOROOT /usr/local/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH

RUN UTBOT_GO_CLI_PATH="$(find /usr/src -type f -name 'utbot-cli*')" \
&& ln -s "${UTBOT_GO_CLI_PATH}" /usr/src/utbot-cli.jar