diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 378f34c6..a520ab1d 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -20,7 +20,7 @@ jobs: # with: # args: './*.md' - docker-lint: + docker-lint-matrix: runs-on: ubuntu-latest strategy: matrix: @@ -37,6 +37,15 @@ jobs: ignore: DL3041,DL3008 dockerfile: Dockerfile.${{ matrix.package }} + docker-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: hadolint/hadolint-action@v2.1.0 + with: + recursive: true + ignore: DL3041,DL3008 + shellcheck: runs-on: ubuntu-latest steps: diff --git a/sztp-agent/Dockerfile b/sztp-agent/Dockerfile new file mode 100644 index 00000000..ee65d604 --- /dev/null +++ b/sztp-agent/Dockerfile @@ -0,0 +1,18 @@ +# syntax=docker/dockerfile:1 + +# Alpine is chosen for its small footprint +# compared to Ubuntu +FROM docker.io/library/golang:1.19.1-alpine + +WORKDIR /app + +# Download necessary Go modules +COPY go.mod ./ +COPY go.sum ./ +RUN go mod download + +# build an app +COPY *.go ./ +RUN go build -o /opi-sztp-agent + +CMD [ "/opi-sztp-agent" ] diff --git a/sztp-agent/go.mod b/sztp-agent/go.mod index 0fe18914..f1f260bf 100644 --- a/sztp-agent/go.mod +++ b/sztp-agent/go.mod @@ -1,4 +1,4 @@ -module github.com/opiproject/sztp/stpd-agent +module github.com/opiproject/sztp/sztp-agent go 1.17