首页 > 其他分享 >基于Android的校园二手闲置物品交易系统设计与实现

基于Android的校园二手闲置物品交易系统设计与实现

时间:2022-12-09 18:36:01浏览次数:78  
标签:container runner image 校园 二手 access entrypoint Android 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,Android,Docker
From: https://www.cnblogs.com/sdfasdf/p/16969702.html

相关文章

  • Android插件化动态加载APK
    什么是插件化动态加载apk?支付宝是万能的,既可以淘票票看电影,又可以买车票,还可以开共享单车,这些都是支付宝的开发人员开发维护的么?显然不是,那么他是怎么做到的呢?是使用了动态......
  • android webview设置自适应任意大小的pc网页
    1.Android:WebView如何设定支持缩放:需要对WebView和WebSettings做一下设定2.WebSettingswebSettings=view.getSettings();3.webSettings.setJavaScriptEnabled(......
  • Android截屏截图的几种方法总结
    Android截屏Android截屏的原理:获取具体需要截屏的区域的Bitmap,然后绘制在画布上,保存为图片后进行分享或者其它用途一、Activity截屏1、截Activity界面(包含空白的状态栏)/......
  • UVCCamera && AndroidUSBCamera示例运行错误的解决办法
    Android设备USB摄像头框架,主要都是基于UVCCamera(github:​​https://github.com/saki4510t/UVCCamera​​​)在此之上,AndroidUSBCamera最新3.x版本支持了多摄像头的使用。......
  • Android13.0 PackageManagerService 的重要改变(package服务的获取)
    PackageManagerService不再extendsIPackageManager.Stub ——> 改为由抽象类IPackageManagerBaseextendsIPackageManager.Stub不再以pkms为基础类addService"p......
  • Android GestureDetector
    之前一直不知道这个类,在Android就以为只有鼠标的down和up事件,原来android为了增加用户体验,新增了GestureDetector类,也就是手势识别类,感觉就是将手指触摸屏幕的touch事件更加......
  • android调试工具DDMS
       DDMS全称DalvikDebugMonitorService.DDMS为IDE和emultor及真正的android设备架起来了一座桥梁,Android DDMS将捕捉到终端的ID,并通过adb建立调试器,从而实现发送指......
  • Android 装载器---重启装载器
    在使用initLoader()方法时,如果指定ID的装载器存在,就使用这个既存的装载器,否则会创建一个新的。但是有些时候你会想要废弃旧的数据并重启装载器。你可以使用restartLoader(......
  • android 动画xml属性总结
    XML中 alpha渐变透明度动画效果scale渐变尺寸伸缩动画效果translate画面转换位置移动动画效果rotate画面转移旋转动画效果JavaCode中 AlphaAnimation渐变透明度动画效果S......
  • [译]Android防止内存的八种方法(下)
    在上一篇​​Android内存泄漏的八种可能(上)​​中,我们讨论了八种容易发生内存泄漏的代码。其中,尤其严重的是泄漏​​Activity​​对象,因为它占用了大量系统内存。不管内存泄......