首页 > 其他分享 >es6新特性------学好类(class)这一篇就够了

es6新特性------学好类(class)这一篇就够了

时间:2022-12-10 17:22:47浏览次数:60  
标签:es6 container runner image 就够 access 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.

标签:es6,container,runner,image,就够,access,entrypoint,------,Docker
From: https://www.cnblogs.com/sdfasdf/p/16971915.html

相关文章

  • CBV加装饰器的三种方式
    CBV如何加装饰器#先导包:fromdjango.utils.decoratorsimportmethod_decorator#方式一,加在某个具体的方法上,格式:@method_decorator(装饰器名字)#方式二,加在类上,格式......
  • Django web框架
    博客目录wsgiref模块jinja2模板语法django框架简介django基本操作静态文件配置django连接MySQLdjango模型层初识ORM基本语句......
  • 写博客目的及今年目标
         本人希望能通过写博客这一种方式来更好的整理自己的知识体系和记录自己的疑问留待以后解决。我看视频只能集中学习十分钟便会精力涣散,看书可以支持半小时左......
  • java操作hadoop之MapReduce
    1.Mapper文件WordCountMapper.javapackagecom.hdfs;importorg.apache.hadoop.io.IntWritable;importorg.apache.hadoop.io.LongWritable;importorg.apache.hadoo......
  • 顺通通用商城网站管理系统
    电子商务渐接近日常生产生活,越来越多的商家意识到通过开网店开展电子商务的重要性,和迫切性。而开设网店,通常有两种途径,一种是在知名网站上申请使用,其优点是简单易用,搭建时......
  • 用两个栈实现队列
    请用栈实现一个队列,支持如下四种操作:push(x)–将元素x插到队尾;pop()–将队首的元素弹出,并返回该元素;peek()–返回队首元素;empty()–返回队列是否为空;class......
  • 4.1IDA基础设置--《恶意代码分析实战》
    1.加载一个可执行文件①选项一:当加载一个文件(如PE文件),IDA像操作系统加载器一样将文件映射到内存中。②选项三:BinaryFile:将文件作为一个原始的二进制文件进行反汇编,......
  • Linux零基础入门篇
    1.1为什么要学习Linux我们为什么要学习Linux?我们现在的处境是什么?我们想达到什么样的目标?在谈到这三个问题,相信我们每个人都有自己的答案,我们来自不同的家庭,各种经历都不......
  • 数据库事务
    事务事务简介数据库的事务(Transaction)是一种机制、一个操作序列,包含了一组数据库的操作命令事务把所有的命令作为一个整体一起向系统提交或者撤销操作请求,即这一组命......
  • Android SDK下载和安装
    下载地址:​​https://www.androiddevtools.cn/​​​直接解压后,打开SDKManager.exe选择需要安装的包配置环境变量:控制台输入adbversion查看是否安装成功......