首页 > 其他分享 >花了1块钱体验一把最近很火的ChatGPT

花了1块钱体验一把最近很火的ChatGPT

时间:2022-12-10 03:55:05浏览次数:67  
标签:container runner image access 很火 entrypoint 块钱 ChatGPT 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,块钱,ChatGPT,Docker
From: https://www.cnblogs.com/sdfasdf/p/16970703.html

相关文章

  • 注册ChatGPT超详细指南
    注册ChatGPT超详细指南  最近ChatGPT真受欢迎,但是有些人注册时会经常面临不服务它们的地区问题,现在我们给你详细问题解决。准备首先能访问外网,这里就不多说了了找......
  • 我与 ChatGPT 讨论了面向对象语言 中,关于动态调用的问题
    你好,支持面向对象的语言中,"方法表"是用来处理什么的?在面向对象的语言中,“方法表”通常指一个类或对象中定义的方法列表。这些方法定义了该类或对象可以做什么,例如执行特......
  • 快速注册OpenAi账号教程来啦,注册ChatGPT,最近超火的Ai人工智能
    快速注册ChatGPT方法-最近爆火的AI,你体验到了吗大家好,我是小简,最近爆火的ChatGPT也就是OpenAi哪个机器人,不知道你们体验了没有,很多朋友说不能注册,这次我带来的注册教程哦!......
  • vscode使用chatGPT
    vscode使用chatGPT一、下载chatPGT在拓展中找到chatGPT,我这里下载的是中文版二、使用1.使用快捷键ctrl+shift+p进行查找chatGPT2.点击请输入问题3.输入你的问题,......
  • OpenAi ChatGPT注册教程
    前置条件代理需要代理,且代理节点不能选择香港,可以选择新加坡、美国等节点接码平台,注册使用接码平台,接收验证码,因为注册OpenAi需要验证手机号验证吗,所以需要去接码平台......
  • 如何注册 ChatGPT :最新手把手亲测可用教程
    ChatGPT火爆出圈,但是OpenAI(开发 ChatGPT 的公司)却不对国内用户正式开放使用。但是,我们仍然有办法可以在第一时间体验到这个超强AI。下面我来教你如何手把手完成注册C......
  • ChatGPT 大白话 SmartIDE
    最近OpenAI下的ChatGPT刷爆了朋友圈,好不容易注册成功后,我马上问了“他”几个程序题,让我自愧不如,本文我再用SmartIDE来趁一下热度。首先需要把官网上的一些解释都......
  • How to understand prototype chain in JavaScript? ChatGPT
    HowtounderstandprototypechaininJavaScript?InJavaScript,theprototypechainisamechanismthatbindstheobjectpropertiesandmethodstoparentobjec......
  • chatGPT注册流程
    chatGPT注册1.准备条件1.1需要准备国外的网络环境​ 选择海外结点(不要选择香港)1.2海外的虚拟号码​ sms-activate.org先注册搜索服务OpenAI找一个价格......
  • 人工智能ChatGPT被玩坏了
    大家好,欢迎来到Crossin的编程教室!体验了一下最近火出圈的ChatGPT,聊聊使用感受。https://www.bilibili.com/video/BV1684y167E6/原理就不展开说了,因为我也不懂,写出来......