代码拉取完成,页面将自动刷新
image: registry.cn-hangzhou.aliyuncs.com/acs-demo-ns/docker:27-dind
cache:
paths:
- .m2/repository
stages:
- build
- deploy
variables:
# When using dind service, you must instruct Docker to talk with
# the daemon started inside of the service. The daemon is available
# with a network connection instead of the default
# /var/run/docker.sock socket.
DOCKER_HOST: tcp://localhost:2376
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/services/#accessing-the-services.
# If you're using GitLab Runner 12.7 or earlier with the Kubernetes executor and Kubernetes 1.6 or earlier,
# the variable must be set to tcp://localhost:2376 because of how the
# Kubernetes executor connects services to the job container
# DOCKER_HOST: tcp://localhost:2376
#
# Specify to Docker where to create the certificates. Docker
# creates them automatically on boot, and creates
# `/certs/client` to share between the service and job
# container, thanks to volume mount from config.toml
DOCKER_TLS_CERTDIR: "/certs"
# These are usually specified by the entrypoint, however the
# Kubernetes executor doesn't run entrypoints
# https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4125
DOCKER_TLS_VERIFY: 1
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
KUBECONFIG: /var/run/secrets/kubernetes.io/serviceaccount/
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
before_script:
- echo "before task"
- ls -al ./
- pwd
- sh /usr/local/bin/dockerd-entrypoint.sh &
- sleep 10s
build_image:
stage: build
tags:
- demo
script:
- docker info
- sleep 1d
- docker build --network host -t demo:v1.0.0 -f Dockerfile .
deploy_to_kubernetes:
stage: deploy
tags:
- demo
script:
- kubectl get pod -n default
only:
- main
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。