From 54c6f20878764c386478b323e0c30e2b9eaadd67 Mon Sep 17 00:00:00 2001 From: "taifu.gc" Date: Thu, 7 Dec 2023 20:45:17 +0800 Subject: [PATCH] Add Alinux2 dockerfile --- BASE/alinux/2/Dockerfile | 24 ++++++++++++++++++++++++ BASE/alinux/2/ci.yaml | 20 ++++++++++++++++++++ BASE/alinux/2/download.sh | 3 +++ BASE/alinux/buildspec.yml | 37 +++++++++++++++++++++++++++++++++++++ BASE/alinux/version.yml | 10 ++++++++++ version-base.yml | 3 ++- 6 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 BASE/alinux/2/Dockerfile create mode 100644 BASE/alinux/2/ci.yaml create mode 100644 BASE/alinux/2/download.sh create mode 100644 BASE/alinux/buildspec.yml create mode 100644 BASE/alinux/version.yml diff --git a/BASE/alinux/2/Dockerfile b/BASE/alinux/2/Dockerfile new file mode 100644 index 0000000..43b7096 --- /dev/null +++ b/BASE/alinux/2/Dockerfile @@ -0,0 +1,24 @@ +FROM scratch +MAINTAINER The Aliyun Linux2 Project + +LABEL org.label-schema.schema-version='1.2' \ + org.label-schema.name='Alinux2 Base Image' \ + org.label-schema.vendor='Aliyun' \ + org.label-schema.license='GPLv2' \ + org.label-schema.build-date=20231213 + +ADD Alinux2-base-amd64-20231228.tar.xz / + +RUN groupadd -g 505 admin \ + && useradd -u 505 -g 505 -G wheel -d /home/admin -s /bin/bash admin \ + && chown -R admin.admin /home/admin \ + && chmod -R 755 /home/admin \ + && sed -i -e 's/#\s\(%wheel.*NOPASSWD.*\)/\1/g' /etc/sudoers \ + && echo -e 'Defaults:admin !requiretty\nadmin ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +RUN sed -i 's/\(^admin:\)[^:]*/\1!!/' /etc/shadow +RUN sed -i 's#file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7#https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-7#g' /etc/yum.repos.d/epel* +RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime + + +CMD ['/bin/bash'] diff --git a/BASE/alinux/2/ci.yaml b/BASE/alinux/2/ci.yaml new file mode 100644 index 0000000..3f268c2 --- /dev/null +++ b/BASE/alinux/2/ci.yaml @@ -0,0 +1,20 @@ +repo: + git_url: https://gitee.com/anolis/docker-images + trigger_mode: pr +test: + docker_build: + test_type: docker + docker_base_test: + tone_test: base_test + base_test: + tone_workspace: container_ci_test + tone_project: default_container_ci_test + tone_test_suite: image-ci-test + tone_test_conf: group=container_startup_test + tone_test_case: baseos_container + server_config: + x86_64: anolis-container-func-test-x86 + aarch64: anolis-container-func-test-arm64 + parallel: + - docker_build + - docker_base_test diff --git a/BASE/alinux/2/download.sh b/BASE/alinux/2/download.sh new file mode 100644 index 0000000..7709440 --- /dev/null +++ b/BASE/alinux/2/download.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +wget https://cr-images-pub.oss-cn-hangzhou.aliyuncs.com/root/base/Alinux2-base-amd64-20231228.tar.xz diff --git a/BASE/alinux/buildspec.yml b/BASE/alinux/buildspec.yml new file mode 100644 index 0000000..983c72e --- /dev/null +++ b/BASE/alinux/buildspec.yml @@ -0,0 +1,37 @@ +name: &NAME +version: &VERSION +image_type: &IMAGE_TYPE +baseos_version: &BASEOS_VERSION + +# 定义镜像仓库信息 +repository_info: + acr: &Alinux2 alibaba-cloud-linux-2-registry.cn-hangzhou.cr.aliyuncs.com/alinux2 + +# 定义镜像测试信息 +t-one: + # 配置测试信息 workspace 和模版 + workspace: &WORKSPACE container_ci_test + project: &PROJECT default_container_ci_test + test_suite: &TEST_SUITE image-ci-test + # template: &TEMPLATE alinux3_baseos_container + test_conf: &TEST_CONF group=baseos_container + test_case: &TEST_CASE alinux3_baseos_container + cloud_server_tag: &CLOUD_SERVER_TAG [anolis-container-ci-x86] + +# 构建镜像配置 +images: + # 分组名称,支持自定义 + BuildAlinuxBaseDockerImage: + # 定义是否构建参数 + build: true + platform: [linux/amd64] + device_type: &DEVICE_TYPE cpu + arch_type: &ARCH_TYPE x86 + docker_file: + path: BASE/alinux/2/Dockerfile + scene: + args: [] + tags: [[231228.1, latest]] + registry: [ *Alinux2 ] + # 测试配置 + test_config: [*WORKSPACE, *PROJECT, *TEST_SUITE, *TEST_CONF, *TEST_CASE, *CLOUD_SERVER_TAG[0], ''] diff --git a/BASE/alinux/version.yml b/BASE/alinux/version.yml new file mode 100644 index 0000000..49685c3 --- /dev/null +++ b/BASE/alinux/version.yml @@ -0,0 +1,10 @@ +# 版本关系依赖表,默认继承 version-base.yml 配置,可重写覆盖 +BaseDependency: ../version-base.yml +Dependency: + name: alinux2 + image_type: base + versions: + 231228.1: + baseos_version: *Alinux2 + latest: + baseos_version: *Alinux2 diff --git a/version-base.yml b/version-base.yml index b6accc5..ebfcf38 100644 --- a/version-base.yml +++ b/version-base.yml @@ -7,4 +7,5 @@ Dependency: Anolis23: 23: &AnolisOS23 [anolisos, 23, openanolis/anolisos:23] Alinux: - 3: &Alinux3 [ alinux, 3, alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3 ] \ No newline at end of file + 3: &Alinux3 [ alinux, 3, alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3 ] + 2: &Alinux2 [ alinux, 2, alibaba-cloud-linux-2-registry.cn-hangzhou.cr.aliyuncs.com/alinux2 ] -- Gitee