首页 > 编程语言 >31岁才转行程序员,目前34了,我的经历和一些感受

31岁才转行程序员,目前34了,我的经历和一些感受

时间:2022-12-19 09:33:54浏览次数:106  
标签:container runner 31 34 access entrypoint image 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,31,34,access,entrypoint,image,Docker,转行
From: https://www.cnblogs.com/sdfasdf/p/16991442.html

相关文章

  • 45册 + 325集 + 31套,Python学习资源【2021精华版本】
    给大家准备了如下资料黄同学经过千挑万选,为大家准备好的资源。45本Python电子书325集Python全栈视频【最新版】Python项目开发实战Python数据分析与机器学习实战【最新视频......
  • 前端开发系列131-进阶篇之Promise源码实现
    title:前端开发系列131-进阶篇之Promise源码实现tags:categories:[]date:2019-10-2701:08:08本文介绍参考[PromiseA+]规范来实现一个符合规范的Promise库。上......
  • 前端开发系列134-进阶篇之脚手架Yue-cli的实现03-download功能
    title:前端开发系列134-进阶篇之脚手架Yue-cli的实现03-download功能tags:categories:[]date:2019-11-0400:00:08这是系列文章前端脚手架实现的第三篇,本文核心解......
  • 郭东白的架构课31
    你好,我是郭东白。从这节课开始,我们就进入到架构活动的第六个环节——阶段性价值交付。对于企业来说,这是成本花费最多的节点了,因为大量的研发人力资源开始投入到架构活动中......
  • Rhino 7 「3D建模工具」v7.26.22343.17002中文版
    Rhino7对于专业的3D设计人员来说它是一款非常不错的3D建模软件!Rhinoceros7mac能轻易整合3DSMAX与Softimage的模型功能部分,犀牛软件mac版对要求精细、弹性与复杂的3DNUR......
  • 老男孩教育 | 已婚已育,30岁0基础转行,成功收获满意的Offer!
    不够优秀,努力来凑~~~不要为懒散和懈怠找任何理由,每天给自己一个希望,路是靠自己走出来的,成功是靠自己努力得到的!!!俗话说:二十而冠,三十而立!30岁是人生分水岭,步......
  • python34
    Python成员运算符除了以上的一些运算符之外,Python还支持成员运算符,测试实例中包含了一系列的成员,包括字符串,列表或元组。运算符描述实例in如果在指定的序列中找到值......
  • python31
    Python 运算符什么是运算符?本章节主要说明Python的运算符。举个简单的例子 4+5=9 。例子中,4 和 5 被称为操作数,+ 称为运算符。Python语言支持以下类型的运......
  • sublime text3 3126 安装配置
    下载​​http://www.sublimetext.com/3​​​序列号如下:支持版本号3126—–BEGINLICENSE—–MichaelBarnesSingleUserLicenseEA7E-8213858......
  • 正则表达式 判断 连号如“123456”、同号如“888888”、连同号如“112233”“222333”
    import java.util.regex.Matcher;    import java.util.regex.Pattern;        public class Regu {            public static voi......