-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (29 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
40 lines (29 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM golang:1.15.6
LABEL org.opencontainers.image.source=https://github.com/jack-michaud/ephemeral-server
ARG TARGETPLATFORM
RUN adduser --home /home/eph --gecos "" --disabled-password eph
RUN apt update && apt install -y unzip golang rsync python-pip
RUN pip install ansible
# Install terraform
RUN echo "$TARGETPLATFORM"
RUN if [ "$TARGETPLATFORM" = "linux/386" ] ; then \
export TERRAFORM_URL="https://releases.hashicorp.com/terraform/0.14.4/terraform_0.14.4_linux_386.zip"; \
elif [ "$TARGETPLATFORM" = "linux/amd64" ] ; then \
export TERRAFORM_URL="https://releases.hashicorp.com/terraform/0.14.4/terraform_0.14.4_linux_amd64.zip"; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ] ; then \
export TERRAFORM_URL="https://releases.hashicorp.com/terraform/0.14.4/terraform_0.14.4_linux_arm.zip"; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ] ; then \
export TERRAFORM_URL="https://releases.hashicorp.com/terraform/0.14.4/terraform_0.14.4_linux_arm64.zip"; \
else \
exit 1; \
fi; \
wget $TERRAFORM_URL -O /tmp/terraform.zip
RUN unzip /tmp/terraform.zip
RUN rm /tmp/terraform.zip
RUN mv terraform /bin/terraform
WORKDIR /code
ADD . /code/
RUN chown -R eph:eph /code
USER eph
RUN make
CMD ["/code/build/ephemeralbot"]