首页 > 编程语言 >[附源码]Python计算机毕业设计Django基于vuejs的爱宠用品销售app

[附源码]Python计算机毕业设计Django基于vuejs的爱宠用品销售app

时间:2022-12-15 18:44:06浏览次数:76  
标签:container Python image access runner 源码 entrypoint 毕业设计 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.

标签:container,Python,image,access,runner,源码,entrypoint,毕业设计,Docker
From: https://www.cnblogs.com/sdfasdf/p/16985826.html

相关文章

  • Java同步器之Condition源码分析
    一、概述条件锁,就是指在获取锁之后发现当前业务场景自己无法处理,而需要等待某个条件的出现才可以继续处理时使用的一种锁。比如,在阻塞队列中,当队列中没有元素的时候是无......
  • Python_帮助系统和自查自学命令
    pythonPython类中,凡是以双下划线"__"开头和结尾命名的成员(属性和方法),都被称为类的特殊成员(特殊属性和特殊方法)。例如,类的init(self)构造方法就是典型的特殊方法库......
  • Python控制语句
    1.控制语句1.1.判断语句if...elif...else#if语句(比较/逻辑/成员均可)#字符串/列表/元组/字典为空返回False,非空返回True#条件成立返回True,不成立返回Falsear......
  • Python super() 详解 最简单的解释
    首先提一下,经典类和新式类。在Python2中,如果定义类的方式是classMyClass:那么该类叫做经典类,如果定义类的方式为classMyClass(object):那么该类为新式类。在Python3中......
  • python使用遍历文件夹文件
    python使用遍历文件夹文件一,遍历函数os.walk(rootdir):#返回三个参数:分别返回1.父目录2.所有文件夹名字(不含路径)3.所有文件名字二,使用importosimportos.pa......
  • 【Python多任务--进程,协程】
    一、进程进程是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础。进程是线程的容器,一个进程可以有多个线程进程特......
  • 【Python多任务--进程池Pool】
    进程池Pool在利用Python进行系统管理的时候,特别是同时操作多个文件目录,或者远程控制多台主机,并行操作可以节约大量的时间。当被操作对象数目不大时,可以直接利用multiprocess......
  • Python算法题
    2.11斐波那契数列1、1、2、3、5、8、13.....已知一个数列:1、1、2、3、5、8、13、。。。。的规律为从3开始的每一项都等于其前两项的和,这是斐波那契数列。求满足规律的......
  • python的元组详解
    names=["zhangsan","lisi","wangwu","zhaoliu"]#从元组中取出来元素print(names[0:3])#打印第0个到第2个元组,取左不取右print(names[-1])#打印元组的最后一个元素#添加元......
  • 使用python爬取微博评论
    最近在复习以前学习的python爬虫内容,就拿微博来练了一下手,这个案例适合学习爬虫到中后期的小伙伴,因为他不是特别简单也不是很难,关键是思路,为什么说不是很难呢?因为还没涉及......