From 342395160f93dd6a801451d35b96ecc890019635 Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Tue, 8 Aug 2023 14:44:37 +0200 Subject: [PATCH 1/9] hadolint check added Signed-off-by: Roger Sikorski --- .gitea/workflows/dev.yaml | 10 ++++++++++ .gitea/workflows/main.yaml | 10 ++++++++++ .hadolint.yaml | 4 ++++ 3 files changed, 24 insertions(+) create mode 100644 .hadolint.yaml diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index 0f15f72..badfb53 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -6,7 +6,17 @@ on: - main jobs: + dockerfile lint: + needs: build + runs-on: k3s + container: + image: gitea.sikorski.cloud/rogersik/hadolint:2 + steps: + - uses: actions/checkout@v3 + - run: hadolint Dockerfile + build: + needs: [dockerfile lint] runs-on: docker steps: - uses: actions/checkout@v3 diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index 3d388c1..9da825c 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -7,7 +7,17 @@ on: - cron: "0 6 * * SUN" jobs: + dockerfile lint: + needs: build + runs-on: k3s + container: + image: gitea.sikorski.cloud/rogersik/hadolint:2 + steps: + - uses: actions/checkout@v3 + - run: hadolint Dockerfile + build: + needs: [dockerfile lint] runs-on: docker steps: - uses: actions/checkout@v3 diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..13dd1e5 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,4 @@ +ignored: + - DL3013 # https://github.com/hadolint/hadolint/wiki/DL3013 allow install latest package + - DL3018 # https://github.com/hadolint/hadolint/wiki/DL3018 no need to pin specific version + - DL3042 # https://github.com/hadolint/hadolint/wiki/DL3042 pip don't know this feature -- 2.45.2 From d54efb18a96e3244bf1aa5228ed3915a426633c9 Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Tue, 8 Aug 2023 14:47:48 +0200 Subject: [PATCH 2/9] switched to alpine 3.18 Signed-off-by: Roger Sikorski --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c26cac5..2c3b0fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -# https://hub.docker.com/_/alpine -FROM alpine:latest +# https://endoflife.date/alpine +FROM alpine:3.18 RUN apk update && \ apk add --no-cache nano mc micro rsync ncdu git curl -- 2.45.2 From 10802a3614a2a433372d59e94087f88cf262d5e8 Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Tue, 8 Aug 2023 14:49:23 +0200 Subject: [PATCH 3/9] Dockerfile: use copy instead add Signed-off-by: Roger Sikorski --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2c3b0fc..d3dbc61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,4 +4,4 @@ FROM alpine:3.18 RUN apk update && \ apk add --no-cache nano mc micro rsync ncdu git curl -ADD ./bin/ /usr/local/bin +COPY --chmod=755 ./bin/ /usr/local/bin -- 2.45.2 From 1dbcbf3ecee7c815e5aec93a941d62a09b3d76c2 Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Tue, 8 Aug 2023 14:50:52 +0200 Subject: [PATCH 4/9] trying k3s for build Signed-off-by: Roger Sikorski --- .gitea/workflows/dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index badfb53..562bee0 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -17,7 +17,7 @@ jobs: build: needs: [dockerfile lint] - runs-on: docker + runs-on: k3s steps: - uses: actions/checkout@v3 - name: docker login -- 2.45.2 From 42dd63c23c6edc63e6e4ed93bd2fd200891f08fc Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Tue, 8 Aug 2023 14:51:26 +0200 Subject: [PATCH 5/9] switch back to docker vm Signed-off-by: Roger Sikorski --- .gitea/workflows/dev.yaml | 4 ++-- .gitea/workflows/main.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index 562bee0..b109f8c 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -8,7 +8,7 @@ on: jobs: dockerfile lint: needs: build - runs-on: k3s + runs-on: docker container: image: gitea.sikorski.cloud/rogersik/hadolint:2 steps: @@ -17,7 +17,7 @@ jobs: build: needs: [dockerfile lint] - runs-on: k3s + runs-on: docker steps: - uses: actions/checkout@v3 - name: docker login diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index 9da825c..2ed81a7 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -9,7 +9,7 @@ on: jobs: dockerfile lint: needs: build - runs-on: k3s + runs-on: docker container: image: gitea.sikorski.cloud/rogersik/hadolint:2 steps: -- 2.45.2 From 9a6266e2bbc20af7084612bdf5ec57c46c2defde Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Tue, 8 Aug 2023 14:52:45 +0200 Subject: [PATCH 6/9] switch back to k3s Signed-off-by: Roger Sikorski --- .gitea/workflows/dev.yaml | 4 ++-- .gitea/workflows/main.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index b109f8c..562bee0 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -8,7 +8,7 @@ on: jobs: dockerfile lint: needs: build - runs-on: docker + runs-on: k3s container: image: gitea.sikorski.cloud/rogersik/hadolint:2 steps: @@ -17,7 +17,7 @@ jobs: build: needs: [dockerfile lint] - runs-on: docker + runs-on: k3s steps: - uses: actions/checkout@v3 - name: docker login diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index 2ed81a7..72cf939 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -9,7 +9,7 @@ on: jobs: dockerfile lint: needs: build - runs-on: docker + runs-on: k3s container: image: gitea.sikorski.cloud/rogersik/hadolint:2 steps: @@ -18,7 +18,7 @@ jobs: build: needs: [dockerfile lint] - runs-on: docker + runs-on: k3s steps: - uses: actions/checkout@v3 - name: docker login -- 2.45.2 From 2617471b243042e4362009e76d99bcdb71158597 Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Tue, 8 Aug 2023 15:05:40 +0200 Subject: [PATCH 7/9] docker build switch to docker vm Signed-off-by: Roger Sikorski --- .gitea/workflows/dev.yaml | 2 +- .gitea/workflows/main.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index 562bee0..badfb53 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -17,7 +17,7 @@ jobs: build: needs: [dockerfile lint] - runs-on: k3s + runs-on: docker steps: - uses: actions/checkout@v3 - name: docker login diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index 72cf939..9da825c 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -18,7 +18,7 @@ jobs: build: needs: [dockerfile lint] - runs-on: k3s + runs-on: docker steps: - uses: actions/checkout@v3 - name: docker login -- 2.45.2 From 15a137ef14ffc1e7560bf6183f455529ac01d2c3 Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Tue, 8 Aug 2023 15:09:18 +0200 Subject: [PATCH 8/9] Kaniko build tried Signed-off-by: Roger Sikorski --- .gitea/workflows/dev.yaml | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index badfb53..d33e7fa 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -20,18 +20,27 @@ jobs: runs-on: docker steps: - uses: actions/checkout@v3 - - name: docker login - run: docker login -u $REGISTRY_USER -p $REGISTRY_PASSWORD gitea.sikorski.cloud - env: - REGISTRY_USER: ${{ secrets.REGISTRY_USER }} - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} - - name: Pull Docker Image for caching - run: docker pull gitea.sikorski.cloud/rogersik/devops-helper:development || exit 0 - - name: Build docker image - run: | - docker build . \ - --cache-from gitea.sikorski.cloud/rogersik/devops-helper:development \ - --file Dockerfile \ - --tag gitea.sikorski.cloud/rogersik/devops-helper:development - - name: Push docker image - run: docker push gitea.sikorski.cloud/rogersik/devops-helper --all-tags + # - name: docker login + # run: docker login -u $REGISTRY_USER -p $REGISTRY_PASSWORD gitea.sikorski.cloud + # env: + # REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + # REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + # - name: Pull Docker Image for caching + # run: docker pull gitea.sikorski.cloud/rogersik/devops-helper:development || exit 0 + # - name: Build docker image + # run: | + # docker build . \ + # --cache-from gitea.sikorski.cloud/rogersik/devops-helper:development \ + # --file Dockerfile \ + # --tag gitea.sikorski.cloud/rogersik/devops-helper:development + # - name: Push docker image + # run: docker push gitea.sikorski.cloud/rogersik/devops-helper --all-tags + + - name: Kaniko build + uses: aevea/action-kaniko@master + with: + registry: gitea.sikorski.cloud + image: rogersik/devops-helper + tag: development + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} -- 2.45.2 From 2778edccbe4dc6830887a54cff668b0504535944 Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Tue, 8 Aug 2023 15:12:54 +0200 Subject: [PATCH 9/9] try again k3s Signed-off-by: Roger Sikorski --- .gitea/workflows/dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index d33e7fa..2d0d18c 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -17,7 +17,7 @@ jobs: build: needs: [dockerfile lint] - runs-on: docker + runs-on: k3s steps: - uses: actions/checkout@v3 # - name: docker login -- 2.45.2