首页 > 编程语言 >[附源码]Python计算机毕业设计Django校园租赁系统

[附源码]Python计算机毕业设计Django校园租赁系统

时间:2022-12-08 11:44:07浏览次数:57  
标签: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/16965664.html

相关文章

  • python 依据IP查找其所属网段
    #coding='utf-8'#依据excel表格中所提供的IP,在另一张表中查找其所属网段importpandasaspdimportIPydf=pd.read_excel('net.xlsx')col_name=df.columns.t......
  • python 合并目标文件夹中多个txt文件到指定文件中
    #coding='utf-8'#description:合并目标文件夹中多个txt文件,到指定文件中。importosdeffile_merge_to_one(dirpath):#创建一个新的文档newfn=dirp......
  • Python控制台中import pyd问题记录
    最近这折腾Python和C++混合编程时候遇到生成的pyd文件无法正常import的问题,网上查询并亲自实践,主要有如下几类:pyd所在路径没有加入到sys.path中,可以手动sys.path.append(......
  • java-net-php-python-sceatch在线学习系统2019演示录像计算机毕业设计程序
    OverridetheentrypointofanimageIntroducedinGitLabandGitLabRunner9.4.Readmoreaboutthe extendedconfigurationoptions.Beforeexplainingtheav......
  • Can‘t find Python executable “python“, you can set the PYTHON env variable
    项目install时报错,卸载掉node-saas,单独安装saas,再install就可以了。npmuninstallnode-sassnpminstallsaas-inpminstall......
  • 极客编程python入门-sorted函数使用
    排序算法Python内置的sorted()函数就可以对list进行排序:>>>sorted([36,5,-12,9,-21])[-21,-12,5,9,36]sorted()函数也是一个高阶函数,它还可以接收一个key函数来实......
  • python初步了解链表
    python数据结构——链表链表由一个个节点组成,每个节点包含自己的存储数据和下一个节点。单链表简单实现先创造一个类来表示节点与节点之间的关系classNode:def......
  • python初步了解栈
    python初步了解栈栈栈是一种后入先出的数据结构。python用列表实现堆栈非常容易,使用append函数,即可实现堆栈,pop()函数即可实现从栈顶取出元素。stack=[3,4,5]stac......
  • python初步了解队列
    python初步了解队列队列是一种先入先出的数据结构单纯用列表来实现队列运用pop()函数,进行出队效率很低,因为在列表开头删除元素需要将其他元素往前移动一位.所以一般用......
  • python浅拷贝和深拷贝
    python浅拷贝和深拷贝python中对对象直接赋值其实只是将其换了一个名字,想要对对象进行真正的复制要通过别的方法。浅拷贝浅拷贝利用copy()函数就可以实现,它会产生新的对......