Skip to content

Commit

Permalink
yq
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyclenerd committed Jan 9, 2025
1 parent ff086fc commit 2ada147
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 16 deletions.
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ ENV AWS_CLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" \
TERRAGRUNT_URL="https://github.com/gruntwork-io/terragrunt/releases/latest/download/terragrunt_linux_amd64" \
TFDOC_URL="https://github.com/terraform-docs/terraform-docs/releases/download/v${TFDOC_VERSION}/terraform-docs-v${TFDOC_VERSION}-linux-amd64.tar.gz" \
TFLINT_URL="https://github.com/terraform-linters/tflint/releases/download/v${TFLINT_VERSION}/tflint_linux_amd64.zip" \
TFSEC_URL="https://github.com/aquasecurity/tfsec/releases/download/v${TFSEC_VERSION}/tfsec_${TFSEC_VERSION}_linux_amd64.tar.gz"
TFSEC_URL="https://github.com/aquasecurity/tfsec/releases/download/v${TFSEC_VERSION}/tfsec_${TFSEC_VERSION}_linux_amd64.tar.gz" \
YQ_URL="https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64"

FROM base AS arm64
# Download URLs for ARM64
Expand All @@ -70,7 +71,8 @@ ENV AWS_CLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" \
TERRAGRUNT_URL="https://github.com/gruntwork-io/terragrunt/releases/latest/download/terragrunt_linux_arm64" \
TFDOC_URL="https://github.com/terraform-docs/terraform-docs/releases/download/v${TFDOC_VERSION}/terraform-docs-v${TFDOC_VERSION}-linux-arm64.tar.gz" \
TFLINT_URL="https://github.com/terraform-linters/tflint/releases/download/v${TFLINT_VERSION}/tflint_linux_arm64.zip" \
TFSEC_URL="https://github.com/aquasecurity/tfsec/releases/download/v${TFSEC_VERSION}/tfsec_${TFSEC_VERSION}_linux_arm64.tar.gz"
TFSEC_URL="https://github.com/aquasecurity/tfsec/releases/download/v${TFSEC_VERSION}/tfsec_${TFSEC_VERSION}_linux_arm64.tar.gz" \
YQ_URL="https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64"

FROM ${TARGETARCH} AS tools
# Install tools
Expand Down Expand Up @@ -197,10 +199,9 @@ RUN uname -m && \
mv "tflint" "/usr/bin/tflint" && \
rm "tflint.zip" && \
# Terragrunt (https://terragrunt.gruntwork.io/)
echo "Terragrunt URL: '$TERRAGRUNT_URL'" && \
curl -L "$TERRAGRUNT_URL" -o "terragrunt" && \
chmod +x "terragrunt" && \
mv "terragrunt" "/usr/bin/terragrunt" && \
echo "Terragrunt URL: '$TERRAGRUNT_URL'" && \
curl -L "$TERRAGRUNT_URL" -o "/usr/bin/terragrunt" && \
chmod +x "/usr/bin/terragrunt" && \
# Open Policy Agent (https://www.openpolicyagent.org/)
echo "OPA URL: '$OPA_URL'" && \
curl -L "$OPA_URL" -o "opa" && \
Expand All @@ -211,6 +212,10 @@ RUN uname -m && \
npm install --global "firebase-tools" && \
# Fix user and group IDs
chown -R root:root "/usr/local/lib/node_modules/firebase-tools" && \
# yq (https://github.com/mikefarah/yq)
echo "yq URL: '$YQ_URL'" && \
curl -L "$YQ_URL" -o "/usr/bin/yq" && \
chmod +x "/usr/bin/yq" && \
# Delete caches
echo "Clean up..." && \
apt-get clean && \
Expand Down Expand Up @@ -243,6 +248,7 @@ RUN uname -m && \
go version && \
hcloud version && \
helm version && \
jq --version && \
kubectl version --client && \
lsb_release -a && \
mutt -v && \
Expand All @@ -265,6 +271,7 @@ RUN uname -m && \
tfsec --version && \
unzip -v && \
vault --version && \
yq --version && \
zip -v

# If you're reading this and have any feedback on how this image could be
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ The following software is included and tested:
* [Helm](https://helm.sh/) package manager for Kubernetes (`helm`)
* [Kubernetes cluster manager](https://kubernetes.io/docs/reference/kubectl/) command line tool for communicating with a Kubernetes cluster (`kubectl`)
* [Vault](https://developer.hashicorp.com/vault) password manager and authentication tool (`vault`)
* [yq](https://github.com/mikefarah/yq) command-line YAML, JSON and XML processor (`yq`)
* Base packages
* GNU bash 5 (`bash`)
* [apt-utils](https://packages.ubuntu.com/lunar/apt-utils)
Expand Down
18 changes: 13 additions & 5 deletions devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ ENV AWS_CLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" \
TERRAGRUNT_URL="https://github.com/gruntwork-io/terragrunt/releases/latest/download/terragrunt_linux_amd64" \
TFDOC_URL="https://github.com/terraform-docs/terraform-docs/releases/download/v${TFDOC_VERSION}/terraform-docs-v${TFDOC_VERSION}-linux-amd64.tar.gz" \
TFLINT_URL="https://github.com/terraform-linters/tflint/releases/download/v${TFLINT_VERSION}/tflint_linux_amd64.zip" \
TFSEC_URL="https://github.com/aquasecurity/tfsec/releases/download/v${TFSEC_VERSION}/tfsec_${TFSEC_VERSION}_linux_amd64.tar.gz"
TFSEC_URL="https://github.com/aquasecurity/tfsec/releases/download/v${TFSEC_VERSION}/tfsec_${TFSEC_VERSION}_linux_amd64.tar.gz" \
YQ_URL="https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64"

FROM base AS arm64
# Download URLs for ARM64
Expand All @@ -64,7 +65,8 @@ ENV AWS_CLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" \
TERRAGRUNT_URL="https://github.com/gruntwork-io/terragrunt/releases/latest/download/terragrunt_linux_arm64" \
TFDOC_URL="https://github.com/terraform-docs/terraform-docs/releases/download/v${TFDOC_VERSION}/terraform-docs-v${TFDOC_VERSION}-linux-arm64.tar.gz" \
TFLINT_URL="https://github.com/terraform-linters/tflint/releases/download/v${TFLINT_VERSION}/tflint_linux_arm64.zip" \
TFSEC_URL="https://github.com/aquasecurity/tfsec/releases/download/v${TFSEC_VERSION}/tfsec_${TFSEC_VERSION}_linux_arm64.tar.gz"
TFSEC_URL="https://github.com/aquasecurity/tfsec/releases/download/v${TFSEC_VERSION}/tfsec_${TFSEC_VERSION}_linux_arm64.tar.gz" \
YQ_URL="https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64"

FROM ${TARGETARCH} AS tools
# Install tools
Expand Down Expand Up @@ -193,9 +195,9 @@ RUN uname -m && \
mv "tflint" "/usr/bin/tflint" && \
rm "tflint.zip" && \
# Terragrunt (https://terragrunt.gruntwork.io/)
curl -L "$TERRAGRUNT_URL" -o "terragrunt" && \
chmod +x "terragrunt" && \
mv "terragrunt" "/usr/bin/terragrunt" && \
echo "Terragrunt URL: '$TERRAGRUNT_URL'" && \
curl -L "$TERRAGRUNT_URL" -o "/usr/bin/terragrunt" && \
chmod +x "/usr/bin/terragrunt" && \
# Open Policy Agent (https://www.openpolicyagent.org/)
curl -L "$OPA_URL" -o "opa" && \
chmod +x "opa" && \
Expand All @@ -205,6 +207,10 @@ RUN uname -m && \
npm install --global "firebase-tools" && \
# Fix user and group IDs
chown -R root:root "/usr/local/lib/node_modules/firebase-tools" && \
# yq (https://github.com/mikefarah/yq)
echo "yq URL: '$YQ_URL'" && \
curl -L "$YQ_URL" -o "/usr/bin/yq" && \
chmod +x "/usr/bin/yq" && \
# Delete caches
echo "Clean up..." && \
apt-get clean && \
Expand Down Expand Up @@ -239,6 +245,7 @@ RUN uname -m && \
go version && \
hcloud version && \
helm version && \
jq --version && \
kubectl version --client && \
lsb_release -a && \
mutt -v && \
Expand All @@ -261,6 +268,7 @@ RUN uname -m && \
tfsec --version && \
unzip -v && \
vault --version && \
yq --version && \
zip -v

# If you're reading this and have any feedback on how this image could be
Expand Down
4 changes: 3 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Test container

MY_COMMANDS=(
"uname -m"
"ansible --version"
"ansible-playbook --version"
"aws --version"
Expand All @@ -20,6 +19,7 @@ MY_COMMANDS=(
"go version"
"hcloud version"
"helm version"
"jq --version"
"kubectl help"
"lsb_release -a"
"mutt -v"
Expand All @@ -40,8 +40,10 @@ MY_COMMANDS=(
"terragrunt --version"
"tflint --version"
"tfsec --version"
"uname -m"
"unzip -v"
"vault --version"
"yq --version"
"zip -v"
)

Expand Down
15 changes: 11 additions & 4 deletions workstations/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ ENV AWS_CLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" \
VSX_GITLAB_URL="https://open-vsx.org/api/GitLab/gitlab-workflow/${VSX_GITLAB_VERSION}/file/GitLab.gitlab-workflow-${VSX_GITLAB_VERSION}.vsix" \
VSX_TERRAFORM_URL="https://open-vsx.org/api/hashicorp/terraform/linux-x64/${VSX_TERRAFORM_VERSION}/file/hashicorp.terraform-${VSX_TERRAFORM_VERSION}@linux-x64.vsix" \
VSX_ICONS_URL="https://open-vsx.org/api/vscode-icons-team/vscode-icons/${VSX_ICONS_VERSION}/file/vscode-icons-team.vscode-icons-${VSX_ICONS_VERSION}.vsix" \
VSX_DOCKER_URL="https://open-vsx.org/api/ms-azuretools/vscode-docker/${VSX_DOCKER_VERSION}/file/ms-azuretools.vscode-docker-${VSX_DOCKER_VERSION}.vsix"
VSX_DOCKER_URL="https://open-vsx.org/api/ms-azuretools/vscode-docker/${VSX_DOCKER_VERSION}/file/ms-azuretools.vscode-docker-${VSX_DOCKER_VERSION}.vsix" \
YQ_URL="https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64"

# Install tools
RUN uname -m && \
Expand Down Expand Up @@ -168,13 +169,17 @@ RUN uname -m && \
mv "tflint" "/usr/bin/tflint" && \
rm "tflint.zip" && \
# Terragrunt (https://terragrunt.gruntwork.io/)
curl -L "$TERRAGRUNT_URL" -o "terragrunt" && \
chmod +x "terragrunt" && \
mv "terragrunt" "/usr/bin/terragrunt" && \
echo "Terragrunt URL: '$TERRAGRUNT_URL'" && \
curl -L "$TERRAGRUNT_URL" -o "/usr/bin/terragrunt" && \
chmod +x "/usr/bin/terragrunt" && \
# Open Policy Agent (https://www.openpolicyagent.org/)
curl -L "$OPA_URL" -o "opa" && \
chmod +x "opa" && \
mv "opa" "/usr/bin/opa" && \
# yq (https://github.com/mikefarah/yq)
echo "yq URL: '$YQ_URL'" && \
curl -L "$YQ_URL" -o "/usr/bin/yq" && \
chmod +x "/usr/bin/yq" && \
# Code OSS extensions
# Terraform
curl -L "$VSX_TERRAFORM_URL" -o "hashicorp.terraform.vsix" && \
Expand Down Expand Up @@ -232,6 +237,7 @@ RUN uname -m && \
go version && \
hcloud version && \
helm version && \
jq --version && \
kubectl version --client && \
lsb_release -a && \
mutt -v && \
Expand All @@ -254,6 +260,7 @@ RUN uname -m && \
tfsec --version && \
unzip -v && \
vault --version && \
yq --version && \
zip -v

# If you're reading this and have any feedback on how this image could be
Expand Down

0 comments on commit 2ada147

Please sign in to comment.