首页 > 编程语言 >Python使用Opencv图像处理方法完成手势识别(一)

Python使用Opencv图像处理方法完成手势识别(一)

时间:2022-12-09 07:44:17浏览次数:64  
标签:container Python image 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,access,Opencv,runner,图像处理,entrypoint,Docker
From: https://www.cnblogs.com/sdfasdf/p/16967949.html

相关文章

  • python中csv库的使用
    CSV文件,是按照逗号进行分隔的文件一、写入操作列表形式逐行写入importcsvheader=['name','gender','age']withopen('./test.csv','w',encoding='utf-8......
  • python之路45 初识django框架
    纯手撸web框架1.web框架的本质理解1:连接前端与数据库的中间介质理解2:socket服务端2.手写web框架1.编写socket服务端代码2.浏览器访问响应无效>>>:HTTP......
  • Python学习基础笔记十九——装饰器
    OverridetheentrypointofanimageIntroducedinGitLabandGitLabRunner9.4.Readmoreaboutthe extendedconfigurationoptions.Beforeexplainingtheav......
  • 圣诞节快到了,教大家用Python画一个简单的圣诞树和烟花,送给那个她
    这不是圣诞节快到了,准备让让女朋友开心开心,也算是亲手做的,稍稍花了点心思。话不多说,咱们直接来展示吧,学会了赶紧画给你的那个她吧!本文分为两个大块,我们先来试试......
  • python3.11 pip 安装包失败: Microsoft Visual C++ 14.0、 cl.exe ...
    近期新发布的Python3.11使用pip安装第三方库时,怎么都安装不上,换成Python3.10就好了,服了,真是服了。第一次尝试:从网上下载了VisualC++2015BuildTools安装,尝试数......
  • 【分享】Python 多缺口滑块验证demo
    <table><tr><tdbgcolor=orange>本文所有教程及源码、软件仅为技术研究。不涉及计算机信息系统功能的删除、修改、增加、干扰,更不会影响计算机信息系统的正常运行。不得将代......
  • PYTHON_数据挖掘
    1.数据读取关键点:read_excel()、read_csv()importpandasaspdpd.read_excel('./股票数据.xlsx')#或者:pd.read_excel('./股票数据.xlsx',sheet_name='Sheet1')i......
  • Python 图片拼接
    <table><tr><tdbgcolor=orange>本文所有教程及源码、软件仅为技术研究。不涉及计算机信息系统功能的删除、修改、增加、干扰,更不会影响计算机信息系统的正常运行。不得将代......
  • python中if的使用
    布尔类型的学习:bool_1=Truebool_2=Falseprint(f"bool_1变量的内容是:{bool_1},数据类型是{type(bool_1)}")print(f"bool_2变量的内容是:{bool_2},数据类型是{type(bool_2)......
  • 进入python的世界_day48_Django初始
    一、纯手撸web框架1.先搭服务端​ 1.因为浏览器就可以当成C\S开发架构的C客户端,我们先写一个简单的服务端importsocketserver=socket.socket()#这里括号不改任......