From f9122d7eee8c73a38fbc971469f581e28d1e7530 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Tue, 26 Jul 2022 17:58:34 +0300 Subject: [PATCH] update linter rules & install air via go install --- .github/workflows/hadolint.yml | 6 ++++-- .hadolint.yaml | 2 ++ 1.16-3.13/Dockerfile | 11 ++++++----- 1.16/Dockerfile | 11 ++++++----- 1.17-3.13/Dockerfile | 11 ++++++----- 1.17/Dockerfile | 11 ++++++----- 1.18-3.13/Dockerfile | 14 ++++++++------ 1.18/Dockerfile | 11 ++++++----- 8 files changed, 44 insertions(+), 33 deletions(-) diff --git a/.github/workflows/hadolint.yml b/.github/workflows/hadolint.yml index b1a4688..a211f6a 100644 --- a/.github/workflows/hadolint.yml +++ b/.github/workflows/hadolint.yml @@ -7,5 +7,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - run: brew install hadolint - - run: hadolint {1.16,1.16-3.13,1.17,1.17-3.13,1.18,1.18-3.13}/Dockerfile + - run: | + brew install hadolint + hadolint {1.16,1.16-3.13,1.17,1.17-3.13,1.18}/Dockerfile + hadolint --ignore=DL3059 --ignore=SC2155 1.18-3.13/Dockerfile diff --git a/.hadolint.yaml b/.hadolint.yaml index 0c19ec5..d7e7c42 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,3 +1,5 @@ ignored: + - DL3003 - DL3018 - DL3017 + - DL4006 diff --git a/1.16-3.13/Dockerfile b/1.16-3.13/Dockerfile index 3630e43..3928660 100644 --- a/1.16-3.13/Dockerfile +++ b/1.16-3.13/Dockerfile @@ -1,12 +1,13 @@ FROM golang:1.16-alpine3.13 -WORKDIR / -RUN apk add --no-cache bash make git gcc libc-dev jq curl dumb-init -RUN cd /tmp && \ +RUN set -eux; \ + apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \ + cd /tmp && \ git clone https://github.com/go-delve/delve && \ cd delve && \ go install github.com/go-delve/delve/cmd/dlv && \ - cd .. && \ - curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin && \ + cd / && \ + go install github.com/cosmtrek/air@latest && \ rm -rf delve && \ chmod -R 777 /go +WORKDIR / ENTRYPOINT ["/usr/bin/dumb-init", "--"] diff --git a/1.16/Dockerfile b/1.16/Dockerfile index aa4d3da..a62c84a 100644 --- a/1.16/Dockerfile +++ b/1.16/Dockerfile @@ -1,12 +1,13 @@ FROM golang:1.16-alpine -WORKDIR / -RUN apk add --no-cache bash make git gcc libc-dev jq curl dumb-init -RUN cd /tmp && \ +RUN set -eux; \ + apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \ + cd /tmp && \ git clone https://github.com/go-delve/delve && \ cd delve && \ go install github.com/go-delve/delve/cmd/dlv && \ - cd .. && \ - curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin && \ + cd / && \ + go install github.com/cosmtrek/air@latest && \ rm -rf delve && \ chmod -R 777 /go +WORKDIR / ENTRYPOINT ["/usr/bin/dumb-init", "--"] diff --git a/1.17-3.13/Dockerfile b/1.17-3.13/Dockerfile index acc7f57..1b9dc82 100644 --- a/1.17-3.13/Dockerfile +++ b/1.17-3.13/Dockerfile @@ -1,12 +1,13 @@ FROM golang:1.17-alpine3.13 -WORKDIR / -RUN apk add --no-cache bash make git gcc libc-dev jq curl dumb-init -RUN cd /tmp && \ +RUN set -eux; \ + apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \ + cd /tmp && \ git clone https://github.com/go-delve/delve && \ cd delve && \ go install github.com/go-delve/delve/cmd/dlv && \ - cd .. && \ - curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin && \ + cd / && \ + go install github.com/cosmtrek/air@latest && \ rm -rf delve && \ chmod -R 777 /go +WORKDIR / ENTRYPOINT ["/usr/bin/dumb-init", "--"] diff --git a/1.17/Dockerfile b/1.17/Dockerfile index 01edb26..b57cf3f 100644 --- a/1.17/Dockerfile +++ b/1.17/Dockerfile @@ -1,12 +1,13 @@ FROM golang:1.17-alpine -WORKDIR / -RUN apk add --no-cache bash make git gcc libc-dev jq curl dumb-init -RUN cd /tmp && \ +RUN set -eux; \ + apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \ + cd /tmp && \ git clone https://github.com/go-delve/delve && \ cd delve && \ go install github.com/go-delve/delve/cmd/dlv && \ - cd .. && \ - curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin && \ + cd / && \ + go install github.com/cosmtrek/air@latest && \ rm -rf delve && \ chmod -R 777 /go +WORKDIR / ENTRYPOINT ["/usr/bin/dumb-init", "--"] diff --git a/1.18-3.13/Dockerfile b/1.18-3.13/Dockerfile index f68e78f..22590d9 100644 --- a/1.18-3.13/Dockerfile +++ b/1.18-3.13/Dockerfile @@ -48,8 +48,8 @@ RUN set -eux; \ # the precompiled binaries published by Go upstream are not compatible with Alpine, so we always build from source here 😅 fi; \ \ - wget -O go.tgz.asc "$url.asc"; \ - wget -O go.tgz "$url"; \ + wget --progress=dot -O go.tgz.asc "$url.asc"; \ + wget --progress=dot -O go.tgz "$url"; \ echo "$sha256 *go.tgz" | sha256sum -c -; \ \ # https://github.com/golang/go/issues/14739#issuecomment-324767697 @@ -105,13 +105,15 @@ ENV PATH $GOPATH/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" WORKDIR $GOPATH -RUN apk add --no-cache bash make git gcc libc-dev jq curl dumb-init -RUN cd /tmp && \ +RUN set -eux; \ + apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \ + cd /tmp && \ git clone https://github.com/go-delve/delve && \ cd delve && \ go install github.com/go-delve/delve/cmd/dlv && \ - cd .. && \ - curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin && \ + cd / && \ + go install github.com/cosmtrek/air@latest && \ rm -rf delve && \ chmod -R 777 /go +WORKDIR / ENTRYPOINT ["/usr/bin/dumb-init", "--"] diff --git a/1.18/Dockerfile b/1.18/Dockerfile index a02edd6..fec8d93 100644 --- a/1.18/Dockerfile +++ b/1.18/Dockerfile @@ -1,12 +1,13 @@ FROM golang:1.18-alpine -WORKDIR / -RUN apk add --no-cache bash make git gcc libc-dev jq curl dumb-init -RUN cd /tmp && \ +RUN set -eux; \ + apk add --no-cache bash make git gcc libc-dev jq curl dumb-init && \ + cd /tmp && \ git clone https://github.com/go-delve/delve && \ cd delve && \ go install github.com/go-delve/delve/cmd/dlv && \ - cd .. && \ - curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin && \ + cd / && \ + go install github.com/cosmtrek/air@latest && \ rm -rf delve && \ chmod -R 777 /go +WORKDIR / ENTRYPOINT ["/usr/bin/dumb-init", "--"]