-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (32 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
40 lines (32 loc) · 1.11 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
40
# Copyright (c) RoseSecurity
# SPDX-License-Identifier: Apache-2.0
FROM golang:alpine@sha256:f85330846cde1e57ca9ec309382da3b8e6ae3ab943d2739500e08c86393a21b1 AS builder
WORKDIR /usr/src/terramaid
# Terraform version
ARG TERRAFORM_VERSION=1.10.0
# Install necessary dependencies
RUN apk update && apk add --no-cache \
bash \
curl \
git \
unzip
# Install Terraform
RUN <<EOF
curl -fsSL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -o terraform.zip
unzip terraform.zip
EOF
# Copy the source code and build
COPY . .
RUN <<EOF
go mod download && go mod verify
go build -v -o ./terramaid main.go
EOF
FROM alpine:3.23.4@sha256:5b10f432ef3da1b8d4c7eb6c487f2f5a8f096bc91145e68878dd4a5019afde11
COPY --from=builder /usr/src/terramaid/terraform /usr/local/bin/terraform
COPY --from=builder /usr/src/terramaid/terramaid /usr/local/bin/terramaid
RUN apk update && apk add --no-cache git
USER nobody
#Set the working directory for Terramaid
WORKDIR /usr/src/terramaid
# Set the entrypoint and default command
ENTRYPOINT ["/usr/local/bin/terramaid"]