-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
51 lines (42 loc) · 2.06 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# This file is a template, and might need editing before it works on your project.
# Official docker image.
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
#services:
# - docker:dind
#
#before_script:
# - export DOCKER_HOST="unix:///var/run/docker.sock"# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
build-master:
stage: build
script:
#- export DOCKER_HOST="tcp://localhost:2375"
#- docker build --network host --pull -t "$CI_REGISTRY_IMAGE" .
#- docker push "$CI_REGISTRY_IMAGE"
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE
- echo "{\"auths\":{\"$CI_REGISTRY_DH\":{\"username\":\"$CI_REGISTRY_USER_DH\",\"password\":\"$CI_REGISTRY_PASSWORD_DH\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE_DH
only:
- master
build-master-arm64:
stage: build
# image: gcr.io/kaniko-project/executor:debug
image: docker:19.03.0
tags:
- aarch64
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --network host --pull -t "$CI_REGISTRY_IMAGE" -f Dockerfile.arm64 .
- docker push "$CI_REGISTRY_IMAGE"
# dh
- docker login -u "$CI_REGISTRY_USER_DH" -p "$CI_REGISTRY_PASSWORD_DH" $CI_REGISTRY_DH
- docker build --network host --pull -t "$CI_REGISTRY_IMAGE_DH:latest-arm64" -f Dockerfile.arm64 .
- docker push "$CI_REGISTRY_IMAGE_DH:latest-arm64"
# - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# - echo $CI_PROJECT_DIR
# - echo $CI_REGISTRY_IMAGE
# - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE
only:
- master