From cc18d860218b38bf8ceac501301b42b9ac25af79 Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 13:12:01 +0200 Subject: [PATCH 01/14] chore: test build --- .github/workflows/build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27832e8..76e20fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,12 +117,9 @@ jobs: asset_name: vistecture-arm64 asset_content_type: application/octet-stream docker: - if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest needs: [ go-binaries ] steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Download go-binary artifact @@ -130,11 +127,6 @@ jobs: with: name: binaries path: build-artifacts - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build uses: docker/build-push-action@v6 with: From 0250dacd52fed73c35d3a42945be91dcaeb70ae7 Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 13:41:16 +0200 Subject: [PATCH 02/14] =?UTF-8?q?=C2=AF\=5F(=E3=83=84)=5F/=C2=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b722fee..fd31df2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM node:15.5.1-alpine3.12 as frontend +FROM node:16.20.2-alpine3.18 AS frontend COPY . /app RUN apk add --update python3 make gcc g++ RUN cd /app/controller/web/template && npm install && npm run build -FROM golang:1.17 as build +FROM golang:1.17 AS build ENV GOOS=linux ENV CGO_ENABLED=0 COPY . /app From 28f5aaabe1b0cc756ff5ea68d1b3e5d411a7a3bd Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 13:45:27 +0200 Subject: [PATCH 03/14] test without npm shizzle --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index fd31df2..1e635e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM node:16.20.2-alpine3.18 AS frontend -COPY . /app -RUN apk add --update python3 make gcc g++ -RUN cd /app/controller/web/template && npm install && npm run build +#FROM node:16.20.2-alpine3.18 AS frontend +#COPY . /app +#RUN apk add --update python3 make gcc g++ +#RUN cd /app/controller/web/template && npm install && npm run build FROM golang:1.17 AS build ENV GOOS=linux ENV CGO_ENABLED=0 COPY . /app -COPY --from=frontend /app/controller/web/template/dist /app/controller/web/template/dist/ +#COPY --from=frontend /app/controller/web/template/dist /app/controller/web/template/dist/ RUN cd /app && go build -o vistecture . FROM alpine:latest From 1a24c1cf6241a9061e9baf9adb1efb56b13dccd8 Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 14:07:46 +0200 Subject: [PATCH 04/14] chore: try macos --- .github/workflows/build.yml | 10 +++++++++- Dockerfile | 10 +++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76e20fb..13dcde6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,9 +117,12 @@ jobs: asset_name: vistecture-arm64 asset_content_type: application/octet-stream docker: - runs-on: ubuntu-latest +# if: startsWith(github.ref, 'refs/tags/v') + runs-on: macos-latest needs: [ go-binaries ] steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Download go-binary artifact @@ -127,6 +130,11 @@ jobs: with: name: binaries path: build-artifacts +# - name: Login to DockerHub +# uses: docker/login-action@v1 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build uses: docker/build-push-action@v6 with: diff --git a/Dockerfile b/Dockerfile index 1e635e5..fd31df2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -#FROM node:16.20.2-alpine3.18 AS frontend -#COPY . /app -#RUN apk add --update python3 make gcc g++ -#RUN cd /app/controller/web/template && npm install && npm run build +FROM node:16.20.2-alpine3.18 AS frontend +COPY . /app +RUN apk add --update python3 make gcc g++ +RUN cd /app/controller/web/template && npm install && npm run build FROM golang:1.17 AS build ENV GOOS=linux ENV CGO_ENABLED=0 COPY . /app -#COPY --from=frontend /app/controller/web/template/dist /app/controller/web/template/dist/ +COPY --from=frontend /app/controller/web/template/dist /app/controller/web/template/dist/ RUN cd /app && go build -o vistecture . FROM alpine:latest From b192f7da602ecf1923b4592623a4237ad3aca4bc Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 14:25:12 +0200 Subject: [PATCH 05/14] yolo --- .github/workflows/build.yml | 2 +- Dockerfile | 2 +- controller/web/template/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13dcde6..0c56fee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,7 +118,7 @@ jobs: asset_content_type: application/octet-stream docker: # if: startsWith(github.ref, 'refs/tags/v') - runs-on: macos-latest + runs-on: ubuntu-latest needs: [ go-binaries ] steps: - name: Set up QEMU diff --git a/Dockerfile b/Dockerfile index fd31df2..cbb32a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.20.2-alpine3.18 AS frontend +FROM node:15.5.1-alpine3.12 AS frontend COPY . /app RUN apk add --update python3 make gcc g++ RUN cd /app/controller/web/template && npm install && npm run build diff --git a/controller/web/template/package.json b/controller/web/template/package.json index 91dc732..6d7eddf 100644 --- a/controller/web/template/package.json +++ b/controller/web/template/package.json @@ -15,6 +15,6 @@ }, "scripts": { "dev": "npx parcel index.html", - "build": "npx parcel build index.html" + "build": "npx parcel build --no-optimize index.html" } } From 364736ab1bc557a2f07011eddf3c3a30033c0cac Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 14:36:07 +0200 Subject: [PATCH 06/14] use latest and greatest --- Dockerfile | 2 +- controller/web/template/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cbb32a7..5e1c852 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:15.5.1-alpine3.12 AS frontend +FROM node:22.3-alpine3.19 AS frontend COPY . /app RUN apk add --update python3 make gcc g++ RUN cd /app/controller/web/template && npm install && npm run build diff --git a/controller/web/template/package.json b/controller/web/template/package.json index 6d7eddf..91dc732 100644 --- a/controller/web/template/package.json +++ b/controller/web/template/package.json @@ -15,6 +15,6 @@ }, "scripts": { "dev": "npx parcel index.html", - "build": "npx parcel build --no-optimize index.html" + "build": "npx parcel build index.html" } } From 5fd5eaeaee7bba4dd3ee52c5bf02959b23f13abf Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 15:43:34 +0200 Subject: [PATCH 07/14] try another way --- .github/workflows/build.yml | 1 + Dockerfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c56fee..85fe711 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,6 +138,7 @@ jobs: - name: Build uses: docker/build-push-action@v6 with: + file: .github/Dockerfile push: true tags: aoepeople/vistecture:${{ github.ref_name }} platforms: linux/amd64,linux/arm64 diff --git a/Dockerfile b/Dockerfile index 5e1c852..0fa3a18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22.3-alpine3.19 AS frontend +FROM node:15.5.1-alpine3.12 as frontend COPY . /app RUN apk add --update python3 make gcc g++ RUN cd /app/controller/web/template && npm install && npm run build From 406bb408d9983323169699210f985c71d33e52b9 Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 15:47:38 +0200 Subject: [PATCH 08/14] use arsch as arg --- .github/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/Dockerfile b/.github/Dockerfile index 213da4b..e56659c 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,4 +1,5 @@ FROM alpine:latest +ARG TARGETARCH RUN apk add --no-cache \ graphviz \ ttf-freefont \ From cef7c38f8b6e533fb8d2e0e57745024883af95d6 Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 15:54:09 +0200 Subject: [PATCH 09/14] show files --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85fe711..bc3c9ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,6 +130,8 @@ jobs: with: name: binaries path: build-artifacts + - name: Display structure of downloaded files + run: ls -R build-artifacts # - name: Login to DockerHub # uses: docker/login-action@v1 # with: From cf26fc59a0d95172c471168dce1e7cf748acebe3 Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 16:01:45 +0200 Subject: [PATCH 10/14] try another context --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc3c9ae..df0c1b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -141,6 +141,7 @@ jobs: uses: docker/build-push-action@v6 with: file: .github/Dockerfile + context: . push: true tags: aoepeople/vistecture:${{ github.ref_name }} platforms: linux/amd64,linux/arm64 From 87b164b2c7e0bcd020953b8c8c1ceafa12f3ea5e Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 16:14:57 +0200 Subject: [PATCH 11/14] test --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df0c1b7..5f32d27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,6 +130,10 @@ jobs: with: name: binaries path: build-artifacts + - name: Display structure of downloaded files + run: pwd + - name: Display structure of downloaded files + run: ls -la - name: Display structure of downloaded files run: ls -R build-artifacts # - name: Login to DockerHub @@ -141,7 +145,6 @@ jobs: uses: docker/build-push-action@v6 with: file: .github/Dockerfile - context: . push: true tags: aoepeople/vistecture:${{ github.ref_name }} platforms: linux/amd64,linux/arm64 From 5f12a7fca76858e8146341934832e5b24df1f34e Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Thu, 27 Jun 2024 16:23:50 +0200 Subject: [PATCH 12/14] test again --- .github/workflows/build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f32d27..c42dc4f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,6 +121,8 @@ jobs: runs-on: ubuntu-latest needs: [ go-binaries ] steps: + - name: Checkout + uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx @@ -130,11 +132,11 @@ jobs: with: name: binaries path: build-artifacts - - name: Display structure of downloaded files + - name: Display structure of downloaded files1 run: pwd - - name: Display structure of downloaded files + - name: Display structure of downloaded files2 run: ls -la - - name: Display structure of downloaded files + - name: Display structure of downloaded files3 run: ls -R build-artifacts # - name: Login to DockerHub # uses: docker/login-action@v1 @@ -144,6 +146,7 @@ jobs: - name: Build uses: docker/build-push-action@v6 with: + context: . file: .github/Dockerfile push: true tags: aoepeople/vistecture:${{ github.ref_name }} From 5d430dbdde24396b31657ca64b9becf588ba73f0 Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Fri, 28 Jun 2024 08:04:01 +0200 Subject: [PATCH 13/14] readd docker login --- .github/workflows/build.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c42dc4f..318c50c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,7 +117,7 @@ jobs: asset_name: vistecture-arm64 asset_content_type: application/octet-stream docker: -# if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest needs: [ go-binaries ] steps: @@ -132,17 +132,11 @@ jobs: with: name: binaries path: build-artifacts - - name: Display structure of downloaded files1 - run: pwd - - name: Display structure of downloaded files2 - run: ls -la - - name: Display structure of downloaded files3 - run: ls -R build-artifacts -# - name: Login to DockerHub -# uses: docker/login-action@v1 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build uses: docker/build-push-action@v6 with: From 471347ca3f027a4f576b021f59592cf4317f8319 Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Fri, 28 Jun 2024 08:05:13 +0200 Subject: [PATCH 14/14] fix dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0fa3a18..cbb32a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:15.5.1-alpine3.12 as frontend +FROM node:15.5.1-alpine3.12 AS frontend COPY . /app RUN apk add --update python3 make gcc g++ RUN cd /app/controller/web/template && npm install && npm run build