首页 > 编程语言 >java-net-php-python-jsp汽车租赁管理系统计算机毕业设计程序

java-net-php-python-jsp汽车租赁管理系统计算机毕业设计程序

时间:2022-12-09 13:23:38浏览次数:62  
标签:java python image access runner entrypoint 毕业设计 container Docker

Override the entrypoint of an image

Introduced in GitLab and GitLab Runner 9.4. Read more about the extended configuration options.

Before explaining the available entrypoint override methods, let’s describe how the runner starts. It uses a Docker image for the containers used in the CI/CD jobs:

  1. The runner starts a Docker container using the defined entrypoint. The default from Dockerfile that may be overridden in the .gitlab-ci.yml file.
  2. The runner attaches itself to a running container.
  3. The runner prepares a script (the combination of before_scriptscript, and after_script).
  4. The runner sends the script to the container’s shell stdin and receives the output.

To override the entrypoint of a Docker image, define an empty entrypoint in the .gitlab-ci.yml file, so the runner does not start a useless shell layer. However, that does not work for all Docker versions.

  • For Docker 17.06 and later, the entrypoint can be set to an empty value.
  • For Docker 17.03 and earlier, the entrypoint can be set to /bin/sh -c/bin/bash -c, or an equivalent shell available in the image.

The syntax of image:entrypoint is similar to Dockerfile’s ENTRYPOINT.

Let’s assume you have a super/sql:experimental image with a SQL database in it. You want to use it as a base image for your job because you want to execute some tests with this database binary. Let’s also assume that this image is configured with /usr/bin/super-sql run as an entrypoint. When the container starts without additional options, it runs the database’s process. The runner expects that the image has no entrypoint or that the entrypoint is prepared to start a shell command.

With the extended Docker configuration options, instead of:

  • Creating your own image based on super/sql:experimental.
  • Setting the ENTRYPOINT to a shell.
  • Using the new image in your CI job.

You can now define an entrypoint in the .gitlab-ci.yml file.

For Docker 17.06 and later:

image:
  name: super/sql:experimental
  entrypoint: [""]

For Docker 17.03 and earlier:

image:
  name: super/sql:experimental
  entrypoint: ["/bin/sh", "-c"]

Define image and services in config.toml

Look for the [runners.docker] section:

[runners.docker]
  image = "ruby:latest"
  services = ["mysql:latest", "postgres:latest"]

The image and services defined this way are added to all jobs run by that runner.

Access an image from a private Container Registry

To access private container registries, the GitLab Runner process can use:

To define which option should be used, the runner process reads the configuration in this order:

  • DOCKER_AUTH_CONFIG CI/CD variable.
  • DOCKER_AUTH_CONFIG environment variable set in the runner’s config.toml file.
  • config.json file in $HOME/.docker directory of the user running the process. If the --user flag is provided to run the child processes as unprivileged user, the home directory of the main runner process user is used.

Requirements and limitations

  • Available for Kubernetes executor in GitLab Runner 13.1 and later.
  • Credentials Store and Credential Helpers require binaries to be added to the GitLab Runner $PATH, and require access to do so. Therefore, these features are not available on shared runners, or any other runner where the user does not have access to the environment where the runner is installed.

Use statically-defined credentials

There are two approaches that you can take to access a private registry. Both require setting the CI/CD variable DOCKER_AUTH_CONFIG with appropriate authentication information.

  1. Per-job: To configure one job to access a private registry, add DOCKER_AUTH_CONFIG as a CI/CD variable.
  2. Per-runner: To configure a runner so all its jobs can access a private registry, add DOCKER_AUTH_CONFIG as an environment variable in the runner’s configuration.

标签:java,python,image,access,runner,entrypoint,毕业设计,container,Docker
From: https://www.cnblogs.com/sdfasdf/p/16968662.html

相关文章

  • 从零开始学Java系列之如何使用记事本编写java程序
    前言在上一篇文章中,壹哥给大家介绍了Java中的标识符及其命名规则、规范,Java里的关键字和保留字,以及Java中的编码规范。我们在之前编写案例时,使用的开发工具都是windows自......
  • 08JavaScript之JavaScript操作DOM对象方法
    通过元素类型的方法来操作:document.getElementById();//id名,在实际开发中较少使用,选择器中多用classid一般只用在顶级层存在不能太过依赖iddocument.getElementsByTagName......
  • Python对json的操作总结
    OverridetheentrypointofanimageIntroducedinGitLabandGitLabRunner9.4.Readmoreaboutthe extendedconfigurationoptions.Beforeexplainingtheav......
  • java基础题目(面试有可能出现)
    1、面向对象(OO)的优点A.与人类的思维习惯一致B.信息隐藏,提高了程序的可维护性和安全性C.提高了程序的可重用行2.通常什么情况下使用数组?使用数组的好处是什么?当需要储存或......
  • [python]Anaconda介绍、安装及使用
    一、什么是Anaconda?简介Anaconda(​​官方网站​​)就是可以便捷获取包且对包能够进行管理,同时对环境可以统一管理的发行版本。Anaconda包含了conda、Python在内的超过180个科......
  • python基础-模块和包
    1.什么是python的包  包就是一个文件夹,里面放着一个个py文件或子包;  在包中可以被调用的一个个py文件,我们叫做模块;    如上,test就是一个包、two.py就是test下......
  • PYTHON 异常处理
    1.1异常处理有时可将程序错误(Error)称作程序异常(Exception)。出现错误程序终止。出现异常程序终止,也可以捕捉异常和撰写异常处理程序,处理完程序可以继续运行。1.1......
  • python中os.system(cmd)函数的返回值:python中的os.system(cmd)的返回值与linux命令返
    前言①在实际开发过程中,经常会遇到在Python代码中调用shell脚本,再获取脚本返回的返回值的情况: os.system(cmd) ②由于系统环境的问题, os.system(cmd) 函数执行命令后......
  • 【Spring】web开发 javaConfig方式 图解
    spring3.2之后开始支持java配置方式开发web项目,不使用web.xml,但需要在servlet3.0环境,一般tomcat7会支持,6不行下图中:MyAppInitializer和SpringServletContainerInitializer是......
  • Python基础语法
    1.continue语句#!/usr/bin/python#-*-coding:UTF-8-*-n=100whilen>0:n-=1ifn%2==0:continueprint(n)#n-......