problem was on self hosted runner
slef hosted runner on dev.ahmza.com was not properly configured with qemu to build multi arch images. Should work now
This commit is contained in:
@@ -4,3 +4,4 @@ styles/
|
|||||||
node_modules
|
node_modules
|
||||||
public/
|
public/
|
||||||
resources/
|
resources/
|
||||||
|
go.sum
|
||||||
|
|||||||
+9
-7
@@ -1,8 +1,11 @@
|
|||||||
image: jdrouet/docker-with-buildx:stable
|
default:
|
||||||
|
image: docker:27.0.3
|
||||||
|
services:
|
||||||
|
- docker:27.0.3-dind
|
||||||
|
before_script:
|
||||||
|
- docker info
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
DOCKER_HOST: tcp://docker:2375
|
|
||||||
DOCKER_DRIVER: overlay2
|
|
||||||
# Major.Minor.Release
|
# Major.Minor.Release
|
||||||
# Major - Shouldn't change often, Big changes to the site
|
# Major - Shouldn't change often, Big changes to the site
|
||||||
# Minor - starts from 0 when Major is incremented +1 for each version that goes public
|
# Minor - starts from 0 when Major is incremented +1 for each version that goes public
|
||||||
@@ -10,15 +13,14 @@ variables:
|
|||||||
VERSION: 1.3.1
|
VERSION: 1.3.1
|
||||||
BUILD: 1 # If set to 0 gitlab will not build the image
|
BUILD: 1 # If set to 0 gitlab will not build the image
|
||||||
IMAGE_TAG: $CI_REGISTRY_IMAGE:$VERSION
|
IMAGE_TAG: $CI_REGISTRY_IMAGE:$VERSION
|
||||||
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||||
- docker buildx create --use
|
- docker context create tls-environment
|
||||||
|
- docker buildx create --use tls-environment --name multi-arch-builder
|
||||||
- docker buildx build --build-arg GITLAB_TOKEN=$GITLAB_TOKEN --no-cache --platform linux/arm64,linux/amd64 -t $IMAGE_TAG --push .
|
- docker buildx build --build-arg GITLAB_TOKEN=$GITLAB_TOKEN --no-cache --platform linux/arm64,linux/amd64 -t $IMAGE_TAG --push .
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "staging") && $BUILD == "1"
|
- if: $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "staging") && $BUILD == "1"
|
||||||
|
|||||||
+8
-13
@@ -1,21 +1,16 @@
|
|||||||
# use the classic alpine image
|
FROM golang:1.22.5-alpine AS build
|
||||||
#FROM alpine as Builder
|
|
||||||
FROM golang:1.22.5-alpine as Builder
|
|
||||||
ARG GITLAB_TOKEN
|
ARG GITLAB_TOKEN
|
||||||
|
|
||||||
# install curl and git
|
# install curl and git
|
||||||
# RUN apk add --update curl git
|
RUN apk add --update curl git
|
||||||
RUN apk add git build-base
|
|
||||||
|
|
||||||
# download and unnzip the hugo binary then place it in /usr/local/bin
|
# download and unnzip the hugo binary
|
||||||
#RUN curl -L https://github.com/gohugoio/hugo/releases/download/v0.121.1/hugo_0.121.1_linux-arm64.tar.gz > hugo.tar.gz && tar -zxf hugo.tar.gz && mv hugo /usr/local/bin
|
RUN curl -L https://github.com/gohugoio/hugo/releases/download/v0.128.2/hugo_0.128.2_linux-arm64.tar.gz > hugo.tar.gz && tar -zxf hugo.tar.gz && mv hugo /usr/local/bin
|
||||||
RUN CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.128.2
|
|
||||||
|
|
||||||
# clone the blog repository as well as the theme submodule
|
# clone the blog repository
|
||||||
# RUN git clone --recurse-submodules https://oauth2:$GITLAB_TOKEN@gitlab.com/AHMZA/blog.git
|
|
||||||
RUN git clone https://oauth2:$GITLAB_TOKEN@gitlab.com/AHMZA/blog.git
|
RUN git clone https://oauth2:$GITLAB_TOKEN@gitlab.com/AHMZA/blog.git
|
||||||
|
|
||||||
# set blog (the folder we just cloned) as the current DIR
|
# set blog (folder we just cloned) as the current DIR
|
||||||
WORKDIR blog
|
WORKDIR blog
|
||||||
|
|
||||||
# run hugo --minify to generate static files
|
# run hugo --minify to generate static files
|
||||||
@@ -26,10 +21,10 @@ RUN hugo --minify --gc
|
|||||||
FROM nginx
|
FROM nginx
|
||||||
|
|
||||||
# copy the nginx.conf file
|
# copy the nginx.conf file
|
||||||
COPY --from=Builder /blog/nginx.conf /etc/nginx/nginx.conf
|
COPY --from=build /go/blog/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
# copy the static files
|
# copy the static files
|
||||||
COPY --from=Builder /blog/public/ /usr/share/nginx/html
|
COPY --from=build /go/blog/public/ /usr/share/nginx/html
|
||||||
|
|
||||||
# Tell the image to expose port 80 for HTTP, SSL provided by reverse proxy.
|
# Tell the image to expose port 80 for HTTP, SSL provided by reverse proxy.
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[hugoVersion]
|
[hugoVersion]
|
||||||
extended = true
|
extended = false
|
||||||
min = "0.87.0"
|
min = "0.87.0"
|
||||||
[[imports]]
|
[[imports]]
|
||||||
path = "github.com/nunocoracao/blowfish/v2"
|
path = "github.com/nunocoracao/blowfish/v2"
|
||||||
|
|||||||
Reference in New Issue
Block a user