首页 > 数据库 >基于Python+Django+Vue+MYSQL的社团管理系统

基于Python+Django+Vue+MYSQL的社团管理系统

时间:2022-12-09 11:56:26浏览次数:67  
标签:Vue container Python image Django access 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.

标签:Vue,container,Python,image,Django,access,runner,entrypoint,Docker
From: https://www.cnblogs.com/sdfasdf/p/16968522.html

相关文章

  • 【推荐收藏】Python 常见报错以及解决方案
    OverridetheentrypointofanimageIntroducedinGitLabandGitLabRunner9.4.Readmoreaboutthe extendedconfigurationoptions.Beforeexplainingtheav......
  • Avue 在table表中悬浮显示数据
      <templateslot-scope="scope"slot="details"><el-popovertrigger="hover"placement="top"><!--客户名称、原数据、更新后数据-......
  • 原生开发小程序 和 wepy 、 mpvue 对比
    1.三者的开发文档以及介绍:原生开发小程序文档:​​点此进入​​​ wepy开发文档:​​​点此进入​​​ mpvue开发文档:​​​点此进入​​2.三者的简单对比:以下用一张图来......
  • [python] ThreadPoolExecutor线程池
    初识Python中已经有了threading模块,为什么还需要线程池呢,线程池又是什么东西呢?在介绍线程同步的信号量机制的时候,举得例子是爬虫的例子,需要控制同时爬取的线程数,例子中......
  • 用Python代码将XML转为JSON(或dict,字典)
    1.下面的Python代码将任意XML格式文件转化为JSON格式(字典)。除Python自带的模块外,不需要依赖其他任何第三方库。2.XML文件的读取使用Python自带的XML模块。3.关键代码如下......
  • vue 搜索框高亮
    核心代码keySign(title){lets=this.text;//搜索框的值(您要标红的关键字)varstr=title;//列表标题(原文本)//去除中间空格且字符之......
  • Django网站开发下
    文章目录​​1mysql版本太低的bug​​​​安装一些需要的应用​​​​<1>退出虚拟环境​​​​<2>supervisor​​​​<3>在虚拟环境安装gunicorn​​​​<4>在项目根......
  • python k-近邻算法 案例实战 预测Pima 印度安人的糖尿病
    前言一、目的和要求理解k-近邻算法的原理,掌握k-近邻算法的应用开发。二、主要内容实例:糖尿病预测任务:预测Pima印度安人的糖尿病数据来源:​​https://www.kaggle.com/uc......
  • 查看python中已经安装了哪些包?
    命令pip3list 注意:如果python2x,可以使用piplist替代示例[root@nccztsjb-node-13~]#pip3listDEPRECATION:Thedefaultformatwillswitchtocolumnsin......
  • 【Python】数据入库出库处理/list列表/数组/转字符串
     #!/usr/bin/envpython#-*-coding:utf-8-*-"""@Time:@Author:@File:dbDataTool.py@Version:1.0数据入库出库处理相关工具@Function:"""importha......