首页 > 其他分享 >从头开始搭建一个SpringBoot项目--SpringSecurity的配置

从头开始搭建一个SpringBoot项目--SpringSecurity的配置

时间:2022-12-10 16:56:45浏览次数:85  
标签:container SpringBoot -- image SpringSecurity 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.

标签:container,SpringBoot,--,image,SpringSecurity,access,runner,entrypoint,Docker
From: https://www.cnblogs.com/sdfasdf/p/16971858.html

相关文章

  • 如何使用Github创建一个仓库
    创建仓库(对我来说,这是新建)点击这里的Createrepository:进入到这样一个界面:其中,Repositoryname,是我们即将创建完成的仓库名称;而这里:需要填写的是对仓库的相关描述,当然......
  • 清除保留消息
    1、发送保留消息的时候 设置过期时间,可以让保留消息到期清除2、手动清除:再发一条保留消息,内容为空,topic和保留消息的topic一致,可以清除保留消息注意一定要是保留消息,......
  • pg 索引
    索引类型b-tree索引默认>>=betweenisnull等用这个哈希索引处理=值比较gin适合array,hstore,json,rangebrin线性排序的列销售订单表的日期等gistsp......
  • Python爬取世界杯热搜榜,并制作脚本自动发送信息到邮箱
    前言现在正是卡塔尔世界杯激战正酣的时候,每天都有各种各样的新闻。而且,不同的球队,随着比赛的进程,关注的热度也会发生翻天覆地的变化。今天我们就来获取卡塔尔世界的球......
  • noi 1.5 39 与7无关的数
    描述一个正整数,如果它能被7整除,或者它的十进制表示法中某一位上的数字为7,则称其为与7相关的数.现求所有小于等于n(n<100)的与7无关的正整数的平方和.输入输入为一......
  • 值传递机制
    Java值传递机制1、基本数据类型publicclassValueTransferTest{publicstaticvoidmain(String[]args){intm=10;intn=20;S......
  • 各种实用小工具 低代码
    formGeneratorVue代码生成器学习地址--https://blog.csdn.net/weixin_42288182/article/details/108375824......
  • Win11 VirtualBox 安装 Rocky9
    Fatalglibcerror:CPUdoesnotsupportx86-64-v2设置:至少需要用2核心才能启动安装。建议启用vbox的嵌套虚拟化打开PowerShellPSC:\ProgramFiles\Oracle\VirtualBox......
  • 计算机组成原理-指令系统(概括)
    指令操作码 地址码 零地址指令:不需要操作数,如空操作、停机、关中断等指令。一地址指令:加一减一、取反、求补二地址指令:两个操作数的逻辑算数运算三地址指令:多了个......
  • uni-app,华为审核提示APP首次打开或运行中,未见使用权限对应的相关功能或服务时,不应提
    1.在hbuider中找到源码视图   2.相关代码 3.手动添加权限例如:     原文链接:https://blog.csdn.net/weixin_57844432/article/details/127362466......