FROM docker.pkgs.xarth.tv/devtools/bionic/go1.15.6:latest

# Setup
# Install AWS CLI
RUN apt-get update && apt-get install -y \
    python3 \
    python3-pip \
    python3-setuptools \
    && pip3 install --upgrade pip \
    && apt-get clean

RUN pip3 --no-cache-dir install --upgrade awscli

# Set Up GoPath
RUN mkdir -p /go/src \
  && mkdir -p /go/bin \
  && mkdir -p /go/pkg
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:$PATH

# Create folder for app code and move the files into it
RUN mkdir -p $GOPATH/src/code.justin.tv/qe/grid_reboot
ADD . $GOPATH/src/code.justin.tv/qe/grid_reboot

# Set the working directory to the source code folder
WORKDIR $GOPATH/src/code.justin.tv/qe/grid_reboot

RUN go build -o grid_reboot .

CMD ["scripts/run_in_container.sh"]
