首页 > 其他分享 >计算机存储器之容量计算详解

计算机存储器之容量计算详解

时间:2022-12-08 10:44:26浏览次数:57  
标签: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.

标签:container,容量,runner,image,存储器,access,详解,entrypoint,Docker
From: https://www.cnblogs.com/sdfasdf/p/16965431.html

相关文章

  • [转]MySQL数据类型详解
    原文地址:https://www.cnblogs.com/lteal/archive/2013/03/04/2943061.htmlMySQL数据类型,可以被分为3类:数值类型、日期和时间类型以及字符串(字符)类型 方括号(“[”和......
  • 万字干货|Synchronized关键字详解
    作者:小牛呼噜噜|https://xiaoniuhululu.com计算机内功、JAVA底层、面试、职业成长相关资料等更多精彩文章在公众号「小牛呼噜噜」前言大家好,我是呼噜噜,在之前的文章......
  • Nginx rewrite 详解
    Nginxrewrite详解本篇主要介绍nginx的rewrite重定向这个功能进行详解介绍,以及介绍它的使用场景1.rewrite基本介绍rewrite是实现URL重写的关键指令,根据reg......
  • 什么叫SSH?原理详解。
    SSH(SecureShell,安全外壳)是一种网络安全协议,通过加密和认证机制实现安全的访问和文件传输等业务。传统远程登录或文件传输方式,例如Telnet、FTP,使用明文传输数据,存在很多的......
  • 【JUC】交换器Exchanger详解
    前言JDK中提供了不少的同步工具,现在分享一个相对比较冷门的同步工具——交换器(Exchanger)。你知道Exchanger的作用是什么吗?实现机制是什么?可以用来做什么呢?Exchanger介绍......
  • ES自定义评分机制:function_score查询详解
    一、function_score介绍主要用于让用户自定义查询相关性得分,实现精细化控制评分的目的。在ES的常规查询中,只有参与了匹配查询的字段才会参与记录的相关性得分score的计算。......
  • session,cookie,token详解
    session,cookie,token详解1.session1.1session的作用是什么session的作用是用于保存每个用户的专用信息;当用户访问时,服务器都会为每个用户分配唯一的SessionID,而且当......
  • Mysql同环比计算详解
    文章目录​​前言​​​​一、什么是同环比​​​​同比​​​​环比​​​​对比​​​​二、同环比计算SQL​​​​1.数据准备​​​​2.年环比和年同比​​​​3.月环比......
  • Mysql加锁流程详解
    目录​​前言​​​​一、锁的内存结构​​​​二、加锁流程​​​​1、加锁的基本流程​​​​2、根据主键加锁​​​​3、根据二级索引加锁​​​​4、根据非索引字段查询......
  • Mysql中锁类型详解
    文章目录​​前言​​​​一、锁的分类​​​​二、锁的特性​​​​1、共享锁和独占锁​​​​2、意向锁​​​​3、标准记录锁RecordLocks​​​​4、间隙锁GapLocks​......