首页 > 编程语言 >OpenCV入门(C++/Python)- 使用OpenCV调整尺寸大小(三)

OpenCV入门(C++/Python)- 使用OpenCV调整尺寸大小(三)

时间:2022-12-08 21:44:50浏览次数:63  
标签:container Python image C++ access OpenCV 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,C++,access,OpenCV,runner,entrypoint,Docker
From: https://www.cnblogs.com/sdfasdf/p/16967428.html

相关文章

  • Python 图片拼接
    本文所有教程及源码、软件仅为技术研究。不涉及计算机信息系统功能的删除、修改、增加、干扰,更不会影响计算机信息系统的正常运行。不得将代码用于非法用途,如侵立删!环境......
  • C++课本的练习题及答案(第六章)
    第六章练习题一、选择题1.下列类的定义中正确的是(   )。(A)classa{intx=0;inty=1;}          (B)classb{intx=0;inty=1;};(C)classc{intx;inty;}     ......
  • C++ 实现视频文件播放(Windows Media Player、MFC、C#)
    文章目录​​1、简介​​​​1.1WMP控件特点​​​​1.2WMP开发接口​​​​1.3WMP开发方式​​​​1.4WMP支持格式​​​​2、官网代码示例​​​​2.1UsingtheWind......
  • c++ md5
    国内c++的md5一搜一大把,试了十几个,都有问题,转国外一篇,暂未发现问题http://www.zedwood.com/article/cpp-md5-functionmain.cpp#include<iostream>#include"md5.h......
  • centos 7 python2.7.5升级到3.5.2
    下载python3.5.2wgethttps://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz安装解压:tar-zxvfPython-3.5.2.tgz进入解压目录:cdPython-3.5.2创建安装目录:mkdir/us......
  • python升级带来的yum异常:File
    CentOS7升级Python到3.5。2后,需要在/usr/bin/python创建了一个指向Python3的软连接,然后将/usr/bin/yum的顶部的:!/usr/bin/python改成了!/usr/bin/python2.7后,运行yum,还是......
  • 搜索文章及代码(Matlab&Python代码实现)
     ......
  • 二、C++面向对象面试题
    二、面向对象1.多态(1)多态的实现有哪几种?黑马程序员C++核心编程第68页静态多态和动态多态。静态多态:是通过重载和模板技术实现的,在编译期间确定函数地址;动态多态:是通过虚函......
  • 纯手撸web框架、基于wsgiref模块、代码封装优化、动静态网页、jinja2模块、前端、后端
    目录纯手撸web框架基于wsgiref模块代码封装优化动静态网页jinja2模块前端、后端、数据库三者联动python主流web框架django简介django基本使用djangoapp的概念django主要目......
  • python集合常用操作汇总
    1.集合类型{}集合是一种无序不可重复的序列;集合常用于对两个列表的交并差处理;集合没有任何获取元素的方法,只用作处理列表或元组的临时数据类型,不适合数据的......