首页 > 编程语言 >java-net-php-python-jspm招警考试模拟题库计算机毕业设计程序

java-net-php-python-jspm招警考试模拟题库计算机毕业设计程序

时间:2022-12-10 11:35:22浏览次数:71  
标签: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/16971296.html

相关文章

  • Python windon 下安装虚拟环境
    1)系统下载虚拟环境:Pipinstall  virtualenv此时虚拟环境下载到了公共python开发环境之中,virtualenv工具自动保存到Python安装目录\Scripts\virtualenv目录下,系统已经......
  • 【Java】【数据库】索引为何使查询变得更快?--B+树
    排序数据的二分查找二分查找的时间复杂度是\(O(log_2n)\),明显快于暴力搜索。索引建立索引的数据,就是通过事先排好顺序,在查找时可以应用二分查找来提高查询效率。所以......
  • 【Python自然语言处理+tkinter图形化界面】实现智能医疗客服问答机器人实战(附源码、数
    OverridetheentrypointofanimageIntroducedinGitLabandGitLabRunner9.4.Readmoreaboutthe extendedconfigurationoptions.Beforeexplainingtheav......
  • Python中列出目录中的文件的五种方法
    1.引言文件和目录相关操作是软件工程师必备的基本技能。我不是说将一个文件复制到Windows文件资源管理器上的另一个文件夹中。我是说使用代码来进行自动化批量处理操作。......
  • Java读取csv导入solr
    publicstaticvoidmain(String[]args){try{//CsvReadercsvReader=null;CsvReadercsvReader=newCsvReader("F:\\ImportData\\01.......
  • JavaScript入门⑩-ES6归纳总结
    JavaScript入门系列目录JavaScript入门①-基础知识筑基JavaScript入门②-函数(1)基础{浅出}JavaScript入门③-函数(2)原理{深入}执行上下文JavaScript入门④-万物皆......
  • python 文件路径
    获取项目的的绝对路径(完整路径)背景:当项目下引用的模块较多时,可通过全局文件路径管理项目importosdefget_root_path():cwd=os.path.abspath(os.path.dirnam......
  • 极客编程python入门-匿名函数
    当我们在传入函数时,有些时候,不需要显式地定义函数,直接传入匿名函数更方便。在Python中,对匿名函数提供了有限支持。>>>list(map(lambdax:x*x,[1,2,3,4,5,6,7,8......
  • Python中星号的五种用法
    1.引言星号​​*​​往往被称为乘法运算符,是所有程序中最为常用的运算符号之一,在Python中,星号还有很多隐藏的强大功能。本文将用最容易理解的例子来解释星号*的五个使......
  • 【Java设计模式】用盖房子案例讲解建造者模式(生成器模式)
    一、前言今天学习了Java设计模式中的建造者模式,细心整理了学习笔记以及对这个模式的自我理解,希望大家喜欢!二、需求介绍现在我们需要建房子,过程为打桩、砌墙、封顶。房子有各......