Skip to content

Commit

Permalink
Forcing wget to use IPv4 (#37)
Browse files Browse the repository at this point in the history
* Update entrypoint.sh

* Update Dockerfile

* Update entrypoint.sh

* Update Dockerfile

* Update Dockerfile

* Update entrypoint.sh

* Update Dockerfile

* Update Dockerfile
  • Loading branch information
jasonjanderson authored Nov 3, 2022
1 parent 8356784 commit 8019886
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM alpine:3.15.2
FROM alpine:3.16.2

RUN apk --no-cache --update add bash
RUN apk --no-cache --update add bash wget

SHELL ["/bin/bash", "-eo", "pipefail", "-c"]

COPY entrypoint.sh /entrypoint.sh
ADD https://github.com/aquasecurity/tfsec/releases/download/v1.28.1/tfsec-linux-amd64 .
RUN install tfsec-linux-amd64 /usr/local/bin/tfsec

ENTRYPOINT ["/entrypoint.sh"]
16 changes: 8 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ if [[ -n "${INPUT_TFSEC_VERSION}" && "$INPUT_TFSEC_VERSION" != "latest" ]]; then
TFSEC_VERSION="tags/${INPUT_TFSEC_VERSION}"
fi

# Pull https://api.github.com/repos/aquasecurity/tfsec/releases for the full list of releases. NOTE no trailing slash
wget -O - -q "$(wget -q https://api.github.com/repos/aquasecurity/tfsec/releases/${TFSEC_VERSION} -O - | grep -m 1 -o -E "https://.+?tfsec-linux-amd64" | head -n1)" > tfsec-linux-amd64
wget -O - -q "$(wget -q https://api.github.com/repos/aquasecurity/tfsec/releases/${TFSEC_VERSION} -O - | grep -m 1 -o -E "https://.+?tfsec_checksums.txt" | head -n1)" > tfsec.checksums

# pipe out the checksum and validate
grep tfsec-linux-amd64 tfsec.checksums > tfsec-linux-amd64.checksum
sha256sum -c tfsec-linux-amd64.checksum
install tfsec-linux-amd64 /usr/local/bin/tfsec
# # Pull https://api.github.com/repos/aquasecurity/tfsec/releases for the full list of releases. NOTE no trailing slash
# wget --inet4-only -O - -q "$(wget --inet4-only -q https://api.github.com/repos/aquasecurity/tfsec/releases/${TFSEC_VERSION} -O - | grep -m 1 -o -E "https://.+?tfsec-linux-amd64" | head -n1)" > tfsec-linux-amd64
# wget --inet4-only -O - -q "$(wget --inet4-only -q https://api.github.com/repos/aquasecurity/tfsec/releases/${TFSEC_VERSION} -O - | grep -m 1 -o -E "https://.+?tfsec_checksums.txt" | head -n1)" > tfsec.checksums

# # pipe out the checksum and validate
# grep tfsec-linux-amd64 tfsec.checksums > tfsec-linux-amd64.checksum
# sha256sum -c tfsec-linux-amd64.checksum
# install tfsec-linux-amd64 /usr/local/bin/tfsec

# if input vars file then add to arguments
if [ -n "${INPUT_TFVARS_FILE}" ]; then
Expand Down

0 comments on commit 8019886

Please sign in to comment.