move to internal server instead

This commit is contained in:
Kasper Juul Hermansen 2022-10-31 01:03:48 +01:00
parent e9e5d1e958
commit cc2aea8c43
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
6 changed files with 15 additions and 15 deletions

View File

@ -1,4 +1,4 @@
FROM harbor.front.kjuulh.io/docker-proxy/library/golang:alpine as builder FROM harbor.server.kjuulh.io/docker-proxy/library/golang:alpine as builder
WORKDIR /src/builder WORKDIR /src/builder
@ -6,7 +6,7 @@ COPY ci/. .
RUN go build -o dist/dagger-go main.go RUN go build -o dist/dagger-go main.go
FROM harbor.front.kjuulh.io/docker-proxy/library/docker:dind FROM harbor.server.kjuulh.io/docker-proxy/library/docker:dind
WORKDIR /src WORKDIR /src

View File

@ -26,7 +26,7 @@ func main() {
}, },
BuildPath: "main.go", BuildPath: "main.go",
BinName: "dagger-go", BinName: "dagger-go",
BaseImage: "harbor.front.kjuulh.io/docker-proxy/library/docker:dind", BaseImage: "harbor.server.kjuulh.io/docker-proxy/library/docker:dind",
}). }).
Execute(ctx) Execute(ctx)

View File

@ -4,13 +4,13 @@ name: "drone-dagger-test"
steps: steps:
- name: "build" - name: "build"
image: harbor.front.kjuulh.io/docker-proxy/library/docker:dind image: harbor.server.kjuulh.io/docker-proxy/library/docker:dind
volumes: volumes:
- name: dockersock - name: dockersock
path: /var/run path: /var/run
environment: environment:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
HARBOR_DOCKER_HOST: "harbor.front.kjuulh.io" HARBOR_DOCKER_HOST: "harbor.server.kjuulh.io"
HARBOR_DOCKER_USERNAME: HARBOR_DOCKER_USERNAME:
from_secret: "harbor_docker_username" from_secret: "harbor_docker_username"
HARBOR_DOCKER_PASSWORD: HARBOR_DOCKER_PASSWORD:
@ -26,8 +26,8 @@ steps:
--username="$${HARBOR_DOCKER_USERNAME}" --username="$${HARBOR_DOCKER_USERNAME}"
"$${HARBOR_DOCKER_HOST}" "$${HARBOR_DOCKER_HOST}"
- > - >
docker pull harbor.front.kjuulh.io/kjuulh/dagger-go-builder:${DRONE_COMMIT} || docker pull harbor.server.kjuulh.io/kjuulh/dagger-go-builder:${DRONE_COMMIT} ||
(docker build -t harbor.front.kjuulh.io/kjuulh/dagger-go-builder:${DRONE_COMMIT} -f tmp/dagger-go/Dockerfile . && docker push harbor.front.kjuulh.io/kjuulh/dagger-go-builder:${DRONE_COMMIT}) (docker build -t harbor.server.kjuulh.io/kjuulh/dagger-go-builder:${DRONE_COMMIT} -f tmp/dagger-go/Dockerfile . && docker push harbor.server.kjuulh.io/kjuulh/dagger-go-builder:${DRONE_COMMIT})
- > - >
docker run docker run
-e DRONE_REPO_NAME="${DRONE_REPO_NAME}" -e DRONE_REPO_NAME="${DRONE_REPO_NAME}"
@ -36,7 +36,7 @@ steps:
-e HARBOR_DOCKER_PASSWORD=$${HARBOR_DOCKER_PASSWORD} -e HARBOR_DOCKER_PASSWORD=$${HARBOR_DOCKER_PASSWORD}
-v "$PWD/:/src/" -v "$PWD/:/src/"
-v /var/run/docker.sock:/var/run/docker.sock -v /var/run/docker.sock:/var/run/docker.sock
harbor.front.kjuulh.io/kjuulh/dagger-go-builder:${DRONE_COMMIT} harbor.server.kjuulh.io/kjuulh/dagger-go-builder:${DRONE_COMMIT}
sh -c 'echo "$$HARBOR_DOCKER_PASSWORD" | docker login sh -c 'echo "$$HARBOR_DOCKER_PASSWORD" | docker login
--password-stdin --password-stdin
--username="$$HARBOR_DOCKER_USERNAME" --username="$$HARBOR_DOCKER_USERNAME"

View File

@ -1,4 +1,4 @@
FROM harbor.front.kjuulh.io/docker-proxy/library/golang:alpine as builder FROM harbor.server.kjuulh.io/docker-proxy/library/golang:alpine as builder
WORKDIR /src/builder WORKDIR /src/builder
@ -6,7 +6,7 @@ COPY tmp/dagger-go .
RUN go build -o dist/dagger-go main.go RUN go build -o dist/dagger-go main.go
FROM harbor.front.kjuulh.io/docker-proxy/library/docker:dind FROM harbor.server.kjuulh.io/docker-proxy/library/docker:dind
WORKDIR /src WORKDIR /src

View File

@ -4,13 +4,13 @@ name: "drone-dagger-test"
steps: steps:
- name: "build" - name: "build"
image: harbor.front.kjuulh.io/kjuulh/dagger-go:1667172485156 image: harbor.server.kjuulh.io/kjuulh/dagger-go:1667172485156
volumes: volumes:
- name: dockersock - name: dockersock
path: /var/run path: /var/run
environment: environment:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
HARBOR_DOCKER_HOST: "harbor.front.kjuulh.io" HARBOR_DOCKER_HOST: "harbor.server.kjuulh.io"
HARBOR_DOCKER_USERNAME: HARBOR_DOCKER_USERNAME:
from_secret: "harbor_docker_username" from_secret: "harbor_docker_username"
HARBOR_DOCKER_PASSWORD: HARBOR_DOCKER_PASSWORD:

View File

@ -47,7 +47,7 @@ func (p *Pipeline) WithGolangBin(opts *GolangBinOpts) *Pipeline {
byg.Step{ byg.Step{
Execute: func(_ byg.Context) error { Execute: func(_ byg.Context) error {
var err error var err error
c := container.LoadImage(client, "harbor.front.kjuulh.io/docker-proxy/library/golang") c := container.LoadImage(client, "harbor.server.kjuulh.io/docker-proxy/library/golang")
c, err = container.MountCurrent(ctx, client, c, "/src") c, err = container.MountCurrent(ctx, client, c, "/src")
if err != nil { if err != nil {
return err return err
@ -73,7 +73,7 @@ func (p *Pipeline) WithGolangBin(opts *GolangBinOpts) *Pipeline {
byg.Step{ byg.Step{
Execute: func(_ byg.Context) error { Execute: func(_ byg.Context) error {
if opts.BaseImage == "" { if opts.BaseImage == "" {
opts.BaseImage = "harbor.front.kjuulh.io/docker-proxy/library/busybox" opts.BaseImage = "harbor.server.kjuulh.io/docker-proxy/library/busybox"
} }
binpath := "/usr/bin" binpath := "/usr/bin"
@ -115,7 +115,7 @@ func (p *Pipeline) WithGolangBin(opts *GolangBinOpts) *Pipeline {
opts.ImageTag = strconv.FormatInt(time.Now().UTC().UnixMilli(), 10) opts.ImageTag = strconv.FormatInt(time.Now().UTC().UnixMilli(), 10)
} }
tag := fmt.Sprintf("harbor.front.kjuulh.io/kjuulh/%s:%s", opts.ImageName, opts.ImageTag) tag := fmt.Sprintf("harbor.server.kjuulh.io/kjuulh/%s:%s", opts.ImageName, opts.ImageTag)
_, err := finalImage.Publish(ctx, tag) _, err := finalImage.Publish(ctx, tag)
return err return err