首页 > 编程语言 >Python+QT美颜工具源码

Python+QT美颜工具源码

时间:2022-12-17 19:56:26浏览次数:78  
标签: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/16989426.html

相关文章

  • 【Python】爬虫笔记-ConnectionResetError(10054)
    0x01在对网站图片进行批量爬取的过程中遇到了一个典型问题:requests.exceptions.ConnectionError:('Connectionaborted.',ConnectionResetError(10054,'Anexisting......
  • Python写个“点球大战”小游戏
    大家好,欢迎来到Crossin的编程教室!看过我Python入门教程的朋友应该会看到其中有提到一个点球小游戏的作业。在世界杯决赛即将到来之际,我们再来回顾一下这个小游戏。......
  • (数据科学学习手札147)Python GIS利器shapely全新2.0版本一览
    本文示例代码已上传至我的Github仓库https://github.com/CNFeffery/DataScienceStudyNotes1简介大家好我是费老师,我写过很多篇介绍geopandas相关技术的文章,而geop......
  • python给文章中手机号打马赛克效果
    python中re模块练习:#coding:utf-8importrecontent="""白日依1999988****山尽,黄河入454654213213213海流。欲穷12456123千里目,更上156475***41一层楼。"""patter......
  • python之路51 聚合查询 分组查询
    图书管理系统1.表设计先考虑普通字段再考虑外键字段数据库迁移、测试数据录入2.首页展示3.书籍展示4.书籍添加5.书籍编辑后端如何获取用户想要编辑的......
  • Python 面向对象
    目录​​python继承​​​​面向对象技术简介​​​​创建类​​​​self代表类的实例,而非类​​​​创建实例对象​​​​访问属性​​​​Python内置类属性​​​​python......
  • Python中open()文件操作/OS目录操作
    File对象测试数据的读写与操作#defopen(file,mode='r',buffering=None,encoding=None,errors=None,newline=None,closefd=True):#knownspecialcaseofo......
  • f-strings: Python字符串处理的瑞士军刀
    从3.6开始,Python新增了一个格式化字符串的方法,称之为f-string。其用法就是在python原始字符串的基础上增加f/F前缀,以大括号{}标明被替换的字段。f-string在本质......
  • Gorm源码学习-创建行记录
    1.前言Gorm源码学习系列Gorm源码学习-数据库连接此文是Gorm源码学习系列的第二篇,主要梳理下通过Gorm创建表的流程。 2.创建行记录代码示例gorm提供了以下几个接......
  • Python学习:内建属性、内建函数的教程
    1.内建属性python3中查看类的内建属性和方法:>>>classPerson:...pass...>>>dir(Person)['__class__','__delattr__','__dict__','__dir__','__doc_......