首页 > 编程语言 >Python中glob类的使用

Python中glob类的使用

时间:2022-12-08 10:44:45浏览次数:50  
标签:container Python glob access runner entrypoint 使用 Docker image

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,glob,access,runner,entrypoint,使用,Docker,image
From: https://www.cnblogs.com/sdfasdf/p/16965429.html

相关文章

  • 10、拦截器Interceptor的使用
    1          什么是拦截器拦截器可以在请求执行流程中的某个位置拦截请求并执行代码,也可以终止请求流程的执行 2          拦截器可以做什么拦截器通常......
  • Python3 多线程并发处理的返回值收集
    库函数threading背景去查询python3多线程,可以找到一大堆关于threading库的博客教程,但是多数是几个线程执行同一个函数(他们博客里各个线程传入的函数参数不同),且没有......
  • 如何使用 qt network 库模拟表单文件上传?
    #include<QCoreApplication>#include<QImage>intmain(intargc,char*argv[]){QCoreApplicationa(argc,argv);//[1]准备图像二进制数据QImage......
  • Oracle安装临时客户端使用总结
    由于把oracle11g全部装在机器上,导致机器太卡,于是卸载oracle装上客户端,果然效果明显。首先要去官网上下载oracle11客户端,(我用的是64位系统)地址:​​http://www.oracle.com/t......
  • python中socke套接字的应用
    socket:问题一:什么是socketsocket(简称套接字)是进程间通信的一种方式,它与其他进程间通信的一个主要不同是:它能实现不同主机间的进程间通信,我们网络上各种各样的服......
  • goland使用技巧
    1、如何显示文件是否发生了修改?   2、添加自定义模板代码如想要生成这段代码的模板:func(this*UserClass)Build(){ this.Handle("GET","/User",this.Ge......
  • Centos 7 + python3 + paramiko + netmiko 安装
    转载自 (31条消息)Centos7下安装Python3并通过Pip安装Paramiko与Netmiko_筐瓢大师小吕的博客-CSDN博客             ......
  • 在idea中使用maven
         maven配置完成创建一个普通的maven项目    项目结构配置  在idea中配置tomcat       ......
  • slam14(1) v4_1 卡尔曼滤波3 使用例子和代码 ardunio mpu6050
     代码https://github.com/TKJElectronics/KalmanFilter   原理剖析原理2卡尔曼融合滤波https://zhuanlan.zhihu.com/p/36374943 关键点1他的偏置和噪声......
  • 关于解决pip安装python第三方库超时的问题
    直接换源下载1.设置超时时间,安装txt文件内安装包pipinstall-ihttps://pypi.tuna.tsinghua.edu.cn/simple--default-timeout=1000-rpackages.txt2.指定源安装,推......