-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cdef5b5
commit a5c5a39
Showing
2 changed files
with
48 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
ARG GOLANG_IMAGE_TAG=1.20 | ||
FROM mcr.microsoft.com/oss/go/microsoft/golang:${GOLANG_IMAGE_TAG} as build | ||
ARG TERRAFORM_DOCS_VERSION=v0.16.0 | ||
ARG TERRAGRUNT_VERSION=v0.43.0 | ||
ARG TFMOD_TEST_HELPER_VERSION=v0.0.22 | ||
ARG TFLINT_VERSION=v0.41.0 | ||
ARG GOLANGCI_LINT_VERSION=v1.49.0 | ||
ARG HCLEDIT_VERSION=v0.2.6 | ||
ARG GOSEC_VERSION=v2.14.0 | ||
|
@@ -48,6 +48,14 @@ RUN cd /src && \ | |
cd yor && git checkout main && \ | ||
go install && \ | ||
cd /src && \ | ||
git clone https://github.com/gruntwork-io/terragrunt.git && \ | ||
cd terragrunt && git checkout $TERRAGRUNT_VERSION && \ | ||
go install && \ | ||
cd /src && \ | ||
git clone https://github.com/lonegunmanb/tflintenv.git && \ | ||
cd tflintenv && cd tflintenv && go install && \ | ||
cd ../tflint && go install && \ | ||
cd /src && \ | ||
git clone https://github.com/lonegunmanb/terrafmt.git && \ | ||
cd terrafmt && \ | ||
go install && \ | ||
|
@@ -62,40 +70,39 @@ RUN cd /src && \ | |
git checkout $TFENV && \ | ||
rm -rf .git | ||
|
||
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 as runner | ||
ARG GOLANG_IMAGE_TAG=1.19 | ||
ARG TERRAFORM_VERSION=1.3.3 | ||
ARG TERRAGRUNT_VERSION=v0.43.0 | ||
ARG TARGETARCH | ||
ARG PACKER_VERSION=1.9.4 | ||
ARG TFSEC_VERSION=v1.28.4 | ||
ENV TFLINT_PLUGIN_DIR /home/runtimeuser/tflint | ||
ENV GOROOT=/usr/local/go | ||
ENV GOPATH=/home/runtimeuser/go | ||
ENV PATH=$PATH:/home/runtimeuser/tfenv/bin:/pkenv/bin:$GOROOT/bin:$GOPATH/bin | ||
ENV TFENV_AUTO_INSTALL=true | ||
ENV TFENV_TERRAFORM_VERSION=$TERRAFORM_VERSION | ||
ENV TF_CLI_CONFIG_FILE=/home/runtimeuser/.terraformrc | ||
RUN yum update -y && \ | ||
yum install -y ca-certificates zip unzip jq python3-devel python3-pip make git less diffutils build-essential openssh-server wget && \ | ||
tdnf install moby-cli ca-certificates -y && \ | ||
pip3 install cryptography -U && \ | ||
pip install azure-cli && \ | ||
wget -q https://go.dev/dl/go${GOLANG_IMAGE_TAG}.linux-${TARGETARCH}.tar.gz && \ | ||
tar -C /usr/local -xzf go*.linux-${TARGETARCH}.tar.gz && \ | ||
rm go${GOLANG_IMAGE_TAG}.linux-${TARGETARCH}.tar.gz && \ | ||
git config --global user.email "[email protected]" && \ | ||
git config --global user.name "github-actions[bot]" && \ | ||
git config --global --add safe.directory '*' | ||
RUN mkdir /home/runtimeuser && \ | ||
chmod -R 777 /home/runtimeuser | ||
COPY .terraformrc /home/runtimeuser/.terraformrc | ||
COPY --from=build /go/bin /usr/local/go/bin | ||
COPY --from=build /src/tfenv /home/runtimeuser/tfenv | ||
RUN chmod 777 /home/runtimeuser/tfenv && \ | ||
curl '-#' -fL -o /bin/terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/${TERRAGRUNT_VERSION}/terragrunt_linux_${TARGETARCH} && \ | ||
chmod +x /bin/terragrunt && \ | ||
git clone https://github.com/iamhsa/pkenv.git /pkenv && \ | ||
cd /pkenv && rm -rf .git && \ | ||
rm -r /tmp/* && \ | ||
yum clean all | ||
#FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 as runner | ||
#ARG GOLANG_IMAGE_TAG=1.19 | ||
#ARG TERRAFORM_VERSION=1.3.3 | ||
#ARG TARGETARCH | ||
#ARG PACKER_VERSION=1.9.4 | ||
#ARG TFSEC_VERSION=v1.28.4 | ||
#ARG TFLINT_VERSION=v0.41.0 | ||
#ENV TFLINT_PLUGIN_DIR /home/runtimeuser/tflint | ||
#ENV GOROOT=/usr/local/go | ||
#ENV GOPATH=/home/runtimeuser/go | ||
#ENV PATH=$PATH:/home/runtimeuser/tfenv/bin:/pkenv/bin:$GOROOT/bin:$GOPATH/bin | ||
#ENV TFLINTENV_DEFAULT_VERSION=$TFLINT_VERSION | ||
#ENV TFENV_AUTO_INSTALL=true | ||
#ENV TFENV_TERRAFORM_VERSION=$TERRAFORM_VERSION | ||
#ENV TF_CLI_CONFIG_FILE=/home/runtimeuser/.terraformrc | ||
#RUN yum update -y && \ | ||
# yum install -y ca-certificates zip unzip jq python3-devel python3-pip make git less diffutils build-essential openssh-server wget && \ | ||
# tdnf install moby-cli ca-certificates -y && \ | ||
# pip3 install cryptography -U && \ | ||
# pip install azure-cli && \ | ||
# wget -q https://go.dev/dl/go${GOLANG_IMAGE_TAG}.linux-${TARGETARCH}.tar.gz && \ | ||
# tar -C /usr/local -xzf go*.linux-${TARGETARCH}.tar.gz && \ | ||
# rm go${GOLANG_IMAGE_TAG}.linux-${TARGETARCH}.tar.gz && \ | ||
# git config --global user.email "[email protected]" && \ | ||
# git config --global user.name "github-actions[bot]" && \ | ||
# git config --global --add safe.directory '*' | ||
#RUN mkdir /home/runtimeuser && \ | ||
# chmod -R 777 /home/runtimeuser | ||
#COPY .terraformrc /home/runtimeuser/.terraformrc | ||
#COPY --from=build /go/bin /usr/local/go/bin | ||
#COPY --from=build /src/tfenv /home/runtimeuser/tfenv | ||
#RUN chmod 777 /home/runtimeuser/tfenv && \ | ||
# git clone https://github.com/iamhsa/pkenv.git /pkenv && \ | ||
# cd /pkenv && rm -rf .git && \ | ||
# rm -r /tmp/* && \ | ||
# yum clean all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters