Compare commits
16 Commits
new_struct
...
feature-ne
Author | SHA1 | Date | |
---|---|---|---|
770fb7021e | |||
911cd2eca1 | |||
156c4b5831 | |||
c7397a6194 | |||
d34a5e2708 | |||
85334e382c | |||
abdd641ac2 | |||
1a1bf5ac64 | |||
a0643aca87 | |||
57aa82cf8c | |||
14da06e02b | |||
3b652fc6b0 | |||
2b923e4c96 | |||
9175f34e52 | |||
f3f74f56dd | |||
31de830d2e |
@ -6,70 +6,53 @@
|
||||
#$4 - ${{ needs.build-process.outputs.repo }}
|
||||
#$5 - ${{ gitea.workspace }}
|
||||
|
||||
BR=${1:-"p10"}
|
||||
ORG=${2:-"base"}
|
||||
URL=${3:-"gitea.basealt.ru"}
|
||||
REPO=${4:-"alt"}
|
||||
WS=${5:-"image-forge"}
|
||||
|
||||
errors=''
|
||||
haserr=false
|
||||
for IM in $(ls $WS/org/$ORG/ | xargs)
|
||||
for IM in $(ls $5/org/$2/ | xargs)
|
||||
do
|
||||
echo "image=$IM"
|
||||
imgpath="$REPO/$BR/$IM:$BR"
|
||||
command=''
|
||||
testpath="$WS/org/$ORG/$IM/test.yaml"
|
||||
if test -f $testpath
|
||||
then
|
||||
entrypoint=''
|
||||
testep=$(cat $testpath | yq '.entrypoint' -r 2> /dev/null)
|
||||
if [[ $testep != '' ]]; then entrypoint="--entrypoint=\"$testep\""; fi
|
||||
if test -f $5/org/$2/$IM/test
|
||||
then
|
||||
test=$(cat $5/org/$2/$IM/test)
|
||||
else test=''
|
||||
fi
|
||||
|
||||
testcom=$(cat $testpath | yq '.command' -r 2> /dev/null)
|
||||
if [[ $testcom != '' ]]
|
||||
then command="podman run --rm $entrypoint $URL/$imgpath -c \"$testcom\""
|
||||
else echo "test command is not found"
|
||||
fi
|
||||
else echo "test file is not found"
|
||||
echo "test script=$test"
|
||||
imgpath="$2/$IM:$1"
|
||||
|
||||
if [[ $2 == 'k8s' ]]
|
||||
then imgpath="$2-$1/$IM:latest"
|
||||
fi
|
||||
echo "result test command: $command"
|
||||
|
||||
command="echo empty_command"
|
||||
if [[ $test != '' ]]; then
|
||||
command="podman run --rm --entrypoint=\"/bin/sh\" $3/$imgpath -c \"$test\""
|
||||
else
|
||||
if [[ $IM = 'distroless-true' ]]; then
|
||||
command="podman run --rm $3/$imgpath \"true\""
|
||||
fi
|
||||
if [[ $IM = 'distroless-gotop' ]]; then
|
||||
command="podman run --rm $3/$imgpath \"--version\""
|
||||
fi
|
||||
if [[ $IM = 'flannel-cni-plugin' ]]; then
|
||||
command="podman run --rm $3/$imgpath \"/flannel\""
|
||||
fi
|
||||
if [[ $IM = 'pause' ]]; then
|
||||
command="podman run --rm $3/$imgpath \"/pause\" \"-v\""
|
||||
fi
|
||||
fi
|
||||
echo $command
|
||||
eval $command 2>$IM.log || haserr=true
|
||||
|
||||
if [ "$haserr" = false ]
|
||||
then
|
||||
echo "start change tag for $IM"
|
||||
if [[ $ORG != 'base' ]]
|
||||
then
|
||||
package=$(podman images --filter reference=$URL/$imgpath --format='{{ json .Labels }}' | jq '."org.opencontainers.image.title"' -r 2> /dev/null)
|
||||
if [[ $package != '' ]]
|
||||
then
|
||||
tag=$(podman run --rm --entrypoint="/bin/sh" $URL/$imgpath -c "rpm -qa --qf \"%{VERSION}\n\" $package" 2> /dev/null)
|
||||
else
|
||||
echo "not found package name in images labels"
|
||||
fi
|
||||
else
|
||||
then tag=$(date +"%Y%m%d")
|
||||
fi
|
||||
|
||||
if [[ $tag != '' ]]
|
||||
then
|
||||
skopeo copy -a docker://$URL/$imgpath:$BR docker://$URL/$imgpath:$tag
|
||||
scopeo delete docker://$URL/$imgpath:$BR
|
||||
echo "tag is updated"
|
||||
else echo "new tag is empty and is not sent to repository"
|
||||
fi
|
||||
|
||||
else
|
||||
if [[ $(cat $IM.log) != '' ]]
|
||||
then errors="TEST ERROR OF IMAGE $IM: $(cat $IM.log); $errors"
|
||||
else errors="TEST ERROR OF IMAGE $IM: test returned empty error, but exit status was nozero; $errors"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "podman rmi --all"
|
||||
podman rmi --all
|
||||
|
||||
if [ "$haserr" = true ]
|
||||
then
|
||||
if [[ $(cat $IM.log) != '' ]]
|
||||
then errors="TEST ERROR OF IMAGE $IM: $(cat $IM.log); $errors"
|
||||
else errors="TEST ERROR OF IMAGE $IM: test returned empty error, but exit status was nozero; $errors"
|
||||
fi
|
||||
fi
|
||||
haserr=false
|
||||
done
|
||||
|
@ -2,10 +2,7 @@ name: Full building alt images
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*_*'
|
||||
tags-ignore:
|
||||
- '*_k8s'
|
||||
- 'sisyphus_*'
|
||||
- '*10*_*'
|
||||
|
||||
jobs:
|
||||
build-process:
|
||||
@ -28,13 +25,6 @@ jobs:
|
||||
env:
|
||||
GU: ${{ gitea.server_url }}
|
||||
GR: ${{ gitea.repository }}
|
||||
- name: Set repo for c10f2 (Temporary)
|
||||
if: ${{ contains(github.ref_name, 'c10f2') }}
|
||||
run: |
|
||||
echo "event tag=${{ github.ref_name }}"
|
||||
echo "10.4.0.3 update.altsp.su" >> /etc/hosts
|
||||
echo "cat /etc/hosts"
|
||||
cat /etc/hosts
|
||||
- name: Update apt
|
||||
uses: actions/init-alt-env@v1
|
||||
- name: Install requires
|
||||
@ -61,10 +51,12 @@ jobs:
|
||||
env:
|
||||
P_USER: ${{ secrets.PODMAN_USER }}
|
||||
P_PASS: ${{ secrets.PODMAN_PASS }}
|
||||
- name: Run standart building script
|
||||
- name: Run building script
|
||||
id: build-script
|
||||
run: |
|
||||
build_args="-b $BR -o $ORG --skip-images base/distroless-devel --overwrite-organization $BR --registry $URL/$BR"
|
||||
build_args="-b $BR -o $ORG --skip-images alt/distroless-devel"
|
||||
if [[ $BR == 'c10f1' || $BR == 'c10f2' ]]; then build_args="$build_args --skip-arches arm ppc64le"; fi
|
||||
if [[ $ORG == 'k8s' ]]; then build_args="$build_args --tags tags.toml --overwrite-organization $ORG-$BR --skip-images k8s/kube-apiserver k8s/kube-controller-manager k8s/kube-proxy k8s/kube-scheduler"; fi
|
||||
echo "build.py $build_args"
|
||||
${{ gitea.workspace }}/build.py $build_args
|
||||
env:
|
||||
@ -103,18 +95,11 @@ jobs:
|
||||
uses: actions/init-alt-env@v1
|
||||
- name: Install requires
|
||||
run: |
|
||||
echo "apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah skopeo jq yq curl"
|
||||
echo "apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah jq curl"
|
||||
apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah jq curl
|
||||
- name: Check out current repo
|
||||
uses: https://gitea.com/actions/checkout@v4
|
||||
- name: Login podman gitea
|
||||
run: |
|
||||
echo "podman login ${{ env.URL }}"
|
||||
podman login --username $P_USER --password $P_PASS ${{ needs.build-process.outputs.url }}
|
||||
env:
|
||||
P_USER: ${{ secrets.PODMAN_USER }}
|
||||
P_PASS: ${{ secrets.PODMAN_PASS }}
|
||||
- name: Test images and update tags
|
||||
- name: Test
|
||||
id: test-script
|
||||
continue-on-error: true
|
||||
run: |
|
||||
|
@ -55,6 +55,7 @@ jobs:
|
||||
id: build-script
|
||||
run: |
|
||||
build_args="-b $BR -o $ORG --skip-images alt/distroless-devel"
|
||||
if [[ $BR == 'sisyphus' ]]; then build_args="$build_args --skip-arches arm"; fi
|
||||
if [[ $ORG == 'k8s' ]]; then build_args="$build_args --tags tags.toml --overwrite-organization $ORG-$BR --skip-images k8s/kube-apiserver k8s/kube-controller-manager k8s/kube-proxy k8s/kube-scheduler"; fi
|
||||
echo "build.py $build_args"
|
||||
${{ gitea.workspace }}/build.py $build_args
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
||||
Dockerfile
|
||||
|
153
branch/README.md
Normal file
153
branch/README.md
Normal file
@ -0,0 +1,153 @@
|
||||
# Описание структуры каталогов для автоматизации рабочео процесса создания образов
|
||||
|
||||
## Общая структура каталогов
|
||||
|
||||
- Вместо каталога `org` предлагается использовать каталог `branch`
|
||||
|
||||
- Каталог `branch` содержит подкаталога бранчей (платформ):
|
||||
* `sisyphus`;
|
||||
* `p10`;
|
||||
* `c10f1`;
|
||||
* `c10f2`;
|
||||
* ...
|
||||
|
||||
Подкаталоги бранчей содержат дерево групп образов.
|
||||
|
||||
Корневая группа `base` содержит образы, которые тегируются по дате создания.
|
||||
Остальные группы тегируются по версии основного ПО, входящего в состав образа.
|
||||
|
||||
Каталог группы может содержать yml-файл `images.yml` описания группы.
|
||||
|
||||
Пример дерева описания образов:
|
||||
<pre>
|
||||
branch/sisyphus/
|
||||
├── apache
|
||||
├── base
|
||||
│ ├── alt
|
||||
│ ├── buildpack
|
||||
│ │ ├── buildpack-deps-curl
|
||||
│ │ └── buildpack-deps-scm
|
||||
│ ├── devel
|
||||
│ ├── distroless
|
||||
│ │ ├── distroless-base
|
||||
│ │ ├── distroless-builder
|
||||
│ │ ├── distroless-devel
|
||||
│ │ ├── distroless-gotop
|
||||
│ │ ├── distroless-static
|
||||
│ │ └── distroless-true
|
||||
│ ├── systemd
|
||||
│ └── unit
|
||||
├── cert-manager
|
||||
│ ├── cert-manager-cainjector
|
||||
│ ├── cert-manager-controller
|
||||
│ └── cert-manager-webhook
|
||||
├── cni
|
||||
│ └── flannel
|
||||
│ ├── flannel
|
||||
│ └── flannel-cni-plugin
|
||||
├── gitea
|
||||
├── k8s
|
||||
│ ├── coredns
|
||||
│ ├── deckhouse
|
||||
│ │ ├── coredns
|
||||
│ │ ├── etcd
|
||||
│ │ ├── kube-apiserver
|
||||
│ │ ├── kube-controller-manager
|
||||
│ │ ├── kube-proxy
|
||||
│ │ ├── kube-scheduler
|
||||
│ │ └── pause
|
||||
│ ├── etcd
|
||||
│ ├── kube-apiserver
|
||||
│ ├── kube-controller-manager
|
||||
│ ├── kube-proxy
|
||||
│ ├── kube-scheduler
|
||||
│ └── pause
|
||||
├── nginx
|
||||
├── prometheus
|
||||
├── python
|
||||
├── registry
|
||||
├── ruby
|
||||
└── trivy
|
||||
└── trivy-node-collector
|
||||
</pre>
|
||||
|
||||
Конечный каталог дерева содержит файлы:
|
||||
|
||||
- **`Dockerfile`** - файл для сборки образа;
|
||||
|
||||
- **`image.yml`** - файл описания метаданных для образа.
|
||||
|
||||
Кроме этого конечный каталог может содержать файлы и каталоги, которые помещаются в образ командами `COPY` и `ADD`.
|
||||
|
||||
Все вышележащие до каталога конкретного бранча (`sisyphus`, `p10`, `c10f1`, `c10f2`, ...) описывают группу (возможно пустую), в которую входит образ.
|
||||
|
||||
Имя образа формируется как тропа дерева каталогов.
|
||||
Например:
|
||||
- `sisyphus/apache`
|
||||
- `sisyphus/k8s/kube-apiserver`
|
||||
|
||||
Имя тега берется либо из файла `image.yml` описания образа, либо из файла описания группы `images.yml`.
|
||||
|
||||
## Конечный каталог описания образа
|
||||
|
||||
### Dockerfile
|
||||
|
||||
Предлагается заменить шаблон `Dockerfile.template` заменить на нативный `Dockerfile`.
|
||||
Все параметры, подставляемые функцией `render_dockerfiles` скрипта
|
||||
[/build.py](https://gitea.basealt.ru/alt/image-forge/src/branch/feature-new-layout/build.py#L249)
|
||||
заменяются на аргументы (`ARG`), инициализируемые непосредственно в `Dockerfile`или передаваемые (с заиещением) при сборко образа параметрами `--build-arg="<ARG>=<VALUE>"`.
|
||||
|
||||
За исключением шаблона `{{ install_pakages("<пакет>" ...) }}`
|
||||
|
||||
Предлагается во все базовые дистрибутивы включить `shell-скрипт` `alt_install_pakages`, выполняющий функции аналогичные
|
||||
python-функции [install_pakages](https://gitea.basealt.ru/alt/image-forge/src/branch/feature-new-layout/build.py#L250).
|
||||
|
||||
Шаблон `{{ install_pakages("<пакет>" ...) }}` заменяется в `Dockerfile` оператором:
|
||||
```
|
||||
RUN alt_install_pakages <пакет> ...
|
||||
```
|
||||
|
||||
Пример файла образа `sisyphus/k8s/kube-apiserver`:
|
||||
<pre>
|
||||
ARG BRANCH REGISTRY=gitea.basealt.ru ALT_IMAGE=base/alt:$BRANCH MAINTAINER=alt-cloud ALT_TESTSCRIPT=/bin/true
|
||||
|
||||
FROM $REGISTRY/$ALT_IMAGE:$BRANCH
|
||||
|
||||
MAINTAINER $MAINTAINER
|
||||
|
||||
LABEL org.altlinux.testscript=$ALT_TESTSCRIPT
|
||||
|
||||
RUN alt_install_pakages kubernetes-master
|
||||
|
||||
ENTRYPOINT ["/usr/bin/kube-apiserver"]
|
||||
</pre>
|
||||
|
||||
### Файл image.yml описания метаданных для образа
|
||||
|
||||
В настоящий момент он содержит (жирным шрифтом обязательные элементы):
|
||||
|
||||
* **`image.maintainer`** - E-mail майнтейнера для создания и проверки электронной подписи образа;
|
||||
|
||||
* `image.alias` - список возможных алиасов образа;
|
||||
|
||||
* `image.tag` - тер образа (может при сборке перекрываться тегом, взятым из вышележащего файла `images.yml` описания группы)
|
||||
|
||||
* `image.labels` - список дополнительных метов образа, в частности:
|
||||
|
||||
- `org.altlinux.testscript` - shell код для тестоиования образа при его запуске в режиме `podman ... -it --- <образ>`
|
||||
|
||||
Пример файла образа `sisyphus/k8s/kube-apiserver`:
|
||||
<pre>
|
||||
version: 1.0
|
||||
image:
|
||||
alias:
|
||||
- k8s-${BRANCH}/${IMAGE}:${TAG}
|
||||
labels:
|
||||
org.altlinux.testscript: /bin/true
|
||||
maintainer: stepchenkoas@basealt.ru
|
||||
</pre>
|
||||
|
||||
|
||||
## Каталог группы
|
||||
|
||||
### Файл `images.yml` описания метаданных группы
|
0
branch/sisyphus/base/alt/Dockerfile
Normal file
0
branch/sisyphus/base/alt/Dockerfile
Normal file
0
branch/sisyphus/base/alt/image.yml
Normal file
0
branch/sisyphus/base/alt/image.yml
Normal file
0
branch/sisyphus/base/devel/Dockerfile
Normal file
0
branch/sisyphus/base/devel/Dockerfile
Normal file
0
branch/sisyphus/base/devel/image.yml
Normal file
0
branch/sisyphus/base/devel/image.yml
Normal file
0
branch/sisyphus/base/systemd/Dockerfile
Normal file
0
branch/sisyphus/base/systemd/Dockerfile
Normal file
0
branch/sisyphus/base/systemd/image.yml
Normal file
0
branch/sisyphus/base/systemd/image.yml
Normal file
0
branch/sisyphus/base/unit/Dockerfile
Normal file
0
branch/sisyphus/base/unit/Dockerfile
Normal file
0
branch/sisyphus/base/unit/image.yml
Normal file
0
branch/sisyphus/base/unit/image.yml
Normal file
13
branch/sisyphus/flannel/flannel-cni-plugin/Dockerfile
Normal file
13
branch/sisyphus/flannel/flannel-cni-plugin/Dockerfile
Normal file
@ -0,0 +1,13 @@
|
||||
FROM {{ registry }}{{ alt_image }}:{{ branch }}
|
||||
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
LABEL org.opencontainers.image.title="flannel-cni-plugin"
|
||||
LABEL org.opencontainers.image.description="CNI network plugin that is powered by flannel"
|
||||
LABEL org.opencontainers.image.source="https://github.com/flannel-io/cni-plugin"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
|
||||
{{ install_pakages("cni-plugin-flannel") }}
|
||||
|
||||
RUN cp /usr/libexec/cni/flannel /flannel
|
28
branch/sisyphus/flannel/flannel/Dockerfile
Normal file
28
branch/sisyphus/flannel/flannel/Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
FROM {{ registry }}{{ alt_image }}:{{ branch }}
|
||||
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
LABEL org.opencontainers.image.title="flannel"
|
||||
LABEL org.opencontainers.image.description="Network fabric for containers"
|
||||
LABEL org.opencontainers.image.source="https://github.com/flannel-io/flannel"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
|
||||
{{ install_pakages(
|
||||
"iproute2",
|
||||
"net-tools",
|
||||
"ca-certificates",
|
||||
"iptables",
|
||||
"iptables-nft",
|
||||
"strongswan",
|
||||
"wireguard-tools",
|
||||
"flannel",
|
||||
"wget",
|
||||
) }}
|
||||
|
||||
RUN update-ca-trust
|
||||
|
||||
RUN mkdir -p /opt/bin/ && cp /usr/sbin/flanneld /opt/bin/flanneld
|
||||
RUN cp /usr/libexec/flannel/mk-docker-opts.sh /opt/bin/
|
||||
|
||||
ENTRYPOINT ["/opt/bin/flanneld"]
|
1
branch/sisyphus/k8s/coredns
Symbolic link
1
branch/sisyphus/k8s/coredns
Symbolic link
@ -0,0 +1 @@
|
||||
../target/coredns/
|
1
branch/sisyphus/k8s/etcd
Symbolic link
1
branch/sisyphus/k8s/etcd
Symbolic link
@ -0,0 +1 @@
|
||||
../target/etcd/
|
11
branch/sisyphus/k8s/kube-apiserver/Dockerfile
Normal file
11
branch/sisyphus/k8s/kube-apiserver/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
ARG BRANCH REGISTRY=gitea.basealt.ru ALT_IMAGE=base/alt:$BRANCH MAINTAINER=alt-cloud ALT_TESTSCRIPT=/bin/true
|
||||
|
||||
FROM $REGISTRY/$ALT_IMAGE:$BRANCH
|
||||
|
||||
MAINTAINER $MAINTAINER
|
||||
|
||||
LABEL org.altlinux.testscript=$ALT_TESTSCRIPT
|
||||
|
||||
RUN alt_install_pakages kubernetes-master
|
||||
|
||||
ENTRYPOINT ["/usr/bin/kube-apiserver"]
|
7
branch/sisyphus/k8s/kube-apiserver/image.yml
Normal file
7
branch/sisyphus/k8s/kube-apiserver/image.yml
Normal file
@ -0,0 +1,7 @@
|
||||
version: 1.0
|
||||
image:
|
||||
alias:
|
||||
- k8s-${BRANCH}/${IMAGE}:${TAG}
|
||||
labels:
|
||||
org.altlinux.testscript: /bin/true
|
||||
maintainer: stepchenkoas@basealt.ru
|
9
branch/sisyphus/k8s/kube-controller-manager/Dockerfile
Normal file
9
branch/sisyphus/k8s/kube-controller-manager/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
ARG BRANCH REGISTRY=gitea.basealt.ru ALT_IMAGE=base/alt:$BRANCH MAINTAINER=alt-cloud ALT_TESTSCRIPT=/bin/true
|
||||
|
||||
FROM $REGISTRY/$ALT_IMAGE:$BRANCH
|
||||
|
||||
MAINTAINER $MAINTAINER
|
||||
|
||||
RUN alt_install_pakages kubernetes-master
|
||||
|
||||
ENTRYPOINT ["/usr/bin/kube-controller-manager"]
|
7
branch/sisyphus/k8s/kube-controller-manager/image.yml
Normal file
7
branch/sisyphus/k8s/kube-controller-manager/image.yml
Normal file
@ -0,0 +1,7 @@
|
||||
version: 1.0
|
||||
image:
|
||||
alias:
|
||||
- k8s-${BRANCH}/${IMAGE}:${TAG}
|
||||
labels:
|
||||
org.altlinux.testscript: /bin/true
|
||||
maintainer: stepchenkoas@basealt.ru
|
11
branch/sisyphus/k8s/kube-proxy/Dockerfile
Normal file
11
branch/sisyphus/k8s/kube-proxy/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
ARG BRANCH REGISTRY=gitea.basealt.ru ALT_IMAGE=base/alt:$BRANCH MAINTAINER=alt-cloud ALT_TESTSCRIPT=/bin/true
|
||||
|
||||
FROM $REGISTRY/$ALT_IMAGE:$BRANCH
|
||||
|
||||
MAINTAINER $MAINTAINER
|
||||
|
||||
RUN alt_install_pakages kubernetes-node
|
||||
|
||||
RUN ln -s /usr/bin/kube-proxy /usr/local/bin/kube-proxy
|
||||
|
||||
ENTRYPOINT ["/usr/bin/kube-proxy"]
|
7
branch/sisyphus/k8s/kube-proxy/image.yml
Normal file
7
branch/sisyphus/k8s/kube-proxy/image.yml
Normal file
@ -0,0 +1,7 @@
|
||||
version: 1.0
|
||||
image:
|
||||
alias:
|
||||
- k8s-${BRANCH}/${IMAGE}:${TAG}
|
||||
labels:
|
||||
org.altlinux.testscript: /bin/true
|
||||
maintainer: stepchenkoas@basealt.ru
|
9
branch/sisyphus/k8s/kube-scheduler/Dockerfile
Normal file
9
branch/sisyphus/k8s/kube-scheduler/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
ARG BRANCH REGISTRY=gitea.basealt.ru ALT_IMAGE=base/alt:$BRANCH MAINTAINER=alt-cloud ALT_TESTSCRIPT=/bin/true
|
||||
|
||||
FROM $REGISTRY/$ALT_IMAGE:$BRANCH
|
||||
|
||||
MAINTAINER $MAINTAINER
|
||||
|
||||
RUN alt_install_pakages kubernetes-master
|
||||
|
||||
ENTRYPOINT ["/usr/bin/kube-scheduler"]
|
7
branch/sisyphus/k8s/kube-scheduler/image.yml
Normal file
7
branch/sisyphus/k8s/kube-scheduler/image.yml
Normal file
@ -0,0 +1,7 @@
|
||||
version: 1.0
|
||||
image:
|
||||
alias:
|
||||
- k8s-${BRANCH}/${IMAGE}:${TAG}
|
||||
labels:
|
||||
org.altlinux.testscript: /bin/true
|
||||
maintainer: stepchenkoas@basealt.ru
|
13
branch/sisyphus/k8s/pause/Dockerfile
Normal file
13
branch/sisyphus/k8s/pause/Dockerfile
Normal file
@ -0,0 +1,13 @@
|
||||
ARG BRANCH REGISTRY=gitea.basealt.ru ALT_IMAGE=base/alt:$BRANCH MAINTAINER=alt-cloud ALT_TESTSCRIPT=/bin/true
|
||||
|
||||
FROM $REGISTRY/$ALT_IMAGE:$BRANCH as installer
|
||||
|
||||
RUN alt_install_pakages kubernetes-pause
|
||||
|
||||
FROM scratch
|
||||
|
||||
MAINTAINER $MAINTAINER
|
||||
|
||||
COPY --from=installer /usr/bin/kubernetes-pause /pause
|
||||
|
||||
CMD ["/pause"]
|
7
branch/sisyphus/k8s/pause/image.yml
Normal file
7
branch/sisyphus/k8s/pause/image.yml
Normal file
@ -0,0 +1,7 @@
|
||||
version: 1.0
|
||||
image:
|
||||
alias:
|
||||
- k8s-${BRANCH}/${IMAGE}:${TAG}
|
||||
labels:
|
||||
org.altlinux.testscript: /bin/true
|
||||
maintainer: stepchenkoas@basealt.ru
|
17
branch/sisyphus/target/apache/Dockerfile
Normal file
17
branch/sisyphus/target/apache/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
ARG BRANCH REGISTRY=gitea.basealt.ru ALT_IMAGE=base/alt:$BRANCH MAINTAINER=alt-cloud ALT_TESTSCRIPT=/bin/true
|
||||
|
||||
FROM $REGISTRY/$ALT_IMAGE:$BRANCH
|
||||
|
||||
MAINTAINER $MAINTAINER
|
||||
|
||||
LABEL org.opencontainers.image.title="apache2"
|
||||
LABEL org.opencontainers.image.description="The most widely used Web server on the Internet"
|
||||
LABEL org.opencontainers.image.source="http://httpd.apache.org"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
|
||||
RUN alt_install_pakages apache2
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["/usr/sbin/httpd2", "-D", "NO_DETACH", "-k", "start"]
|
16
branch/sisyphus/target/coredns/Dockerfile
Normal file
16
branch/sisyphus/target/coredns/Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
ARG BRANCH REGISTRY=gitea.basealt.ru ALT_IMAGE=base/alt:$BRANCH MAINTAINER=alt-cloud ALT_TESTSCRIPT=/bin/true
|
||||
|
||||
FROM $REGISTRY/$ALT_IMAGE:$BRANCH
|
||||
|
||||
MAINTAINER $MAINTAINER
|
||||
|
||||
LABEL org.opencontainers.image.title="coredns"
|
||||
LABEL org.opencontainers.image.description="CoreDNS is a DNS server that chains plugins"
|
||||
LABEL org.opencontainers.image.source="https://github.com/coredns/coredns"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
LABEL org.altlinux.testscript=$ALT_TESTSCRIPT
|
||||
|
||||
RUN alt_install_pakages coredns
|
||||
|
||||
ENTRYPOINT ["/usr/bin/coredns"]
|
7
branch/sisyphus/target/coredns/image.yml
Normal file
7
branch/sisyphus/target/coredns/image.yml
Normal file
@ -0,0 +1,7 @@
|
||||
version: 1.0
|
||||
image:
|
||||
alias:
|
||||
- k8s-${BRANCH}/${IMAGE}:${TAG}
|
||||
labels:
|
||||
org.altlinux.testscript: /bin/true
|
||||
maintainer: stepchenkoas@basealt.ru
|
0
branch/sisyphus/target/etcd/Dockerfile
Normal file
0
branch/sisyphus/target/etcd/Dockerfile
Normal file
0
branch/sisyphus/target/etcd/image.yml
Normal file
0
branch/sisyphus/target/etcd/image.yml
Normal file
0
branch/sisyphus/target/gitea/Dockerfile
Normal file
0
branch/sisyphus/target/gitea/Dockerfile
Normal file
0
branch/sisyphus/target/gitea/image.yml
Normal file
0
branch/sisyphus/target/gitea/image.yml
Normal file
0
branch/sisyphus/target/nginx/Dockerfile
Normal file
0
branch/sisyphus/target/nginx/Dockerfile
Normal file
0
branch/sisyphus/target/nginx/image.yml
Normal file
0
branch/sisyphus/target/nginx/image.yml
Normal file
0
branch/sisyphus/target/prometheus/Dockerfile
Normal file
0
branch/sisyphus/target/prometheus/Dockerfile
Normal file
0
branch/sisyphus/target/prometheus/image.yml
Normal file
0
branch/sisyphus/target/prometheus/image.yml
Normal file
0
branch/sisyphus/target/python/Dockerfile
Normal file
0
branch/sisyphus/target/python/Dockerfile
Normal file
0
branch/sisyphus/target/python/image.yml
Normal file
0
branch/sisyphus/target/python/image.yml
Normal file
0
branch/sisyphus/target/registry/Dockerfile
Normal file
0
branch/sisyphus/target/registry/Dockerfile
Normal file
0
branch/sisyphus/target/registry/image.yml
Normal file
0
branch/sisyphus/target/registry/image.yml
Normal file
0
branch/sisyphus/target/ruby/Dockerfile
Normal file
0
branch/sisyphus/target/ruby/Dockerfile
Normal file
0
branch/sisyphus/target/ruby/image.yml
Normal file
0
branch/sisyphus/target/ruby/image.yml
Normal file
17
branch/sisyphus/target/trivy-node-collector/Dockerfile
Normal file
17
branch/sisyphus/target/trivy-node-collector/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
FROM {{ registry }}{{ alt_image }}:{{ branch }}
|
||||
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
LABEL org.opencontainers.image.title="trivy-node-collector"
|
||||
LABEL org.opencontainers.image.description="Open source collector who collect Node information (fs and process data) and output in a table/json format"
|
||||
LABEL org.opencontainers.image.source="https://github.com/aquasecurity/k8s-node-collector"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
|
||||
{{ install_pakages(
|
||||
"k8s-trivy-node-collector"
|
||||
) }}
|
||||
|
||||
RUN ln -s /usr/bin/k8s-trivy-node-collector /usr/bin/node-collector
|
||||
|
||||
ENTRYPOINT ["node-collector"]
|
0
branch/sisyphus/target/trivy/Dockerfile
Normal file
0
branch/sisyphus/target/trivy/Dockerfile
Normal file
0
branch/sisyphus/target/trivy/image.yml
Normal file
0
branch/sisyphus/target/trivy/image.yml
Normal file
42
build.py
42
build.py
@ -225,7 +225,7 @@ class DockerBuilder:
|
||||
self,
|
||||
template: str,
|
||||
organization: str,
|
||||
install_packages=None,
|
||||
install_pakages=None,
|
||||
**kwargs,
|
||||
) -> str:
|
||||
if self.registry:
|
||||
@ -237,7 +237,7 @@ class DockerBuilder:
|
||||
rendered = Template(template).render(
|
||||
alt_image=alt_image,
|
||||
branch=self.branch,
|
||||
install_packages=install_packages,
|
||||
install_pakages=install_pakages,
|
||||
organization=organization,
|
||||
registry=registry,
|
||||
**kwargs,
|
||||
@ -247,7 +247,7 @@ class DockerBuilder:
|
||||
|
||||
@forall_images(consume_result=True)
|
||||
def render_dockerfiles(self, **kwargs):
|
||||
def install_packages(*names):
|
||||
def install_pakages(*names):
|
||||
tasks = self.tasks.get(self.branch, kwargs["image"])
|
||||
linux32 = '$([ "$(rpm --eval %_host_cpu)" = i586 ] && echo linux32)'
|
||||
if tasks:
|
||||
@ -273,7 +273,7 @@ class DockerBuilder:
|
||||
rendered = self.render_template(
|
||||
dockerfile_template.read_text(),
|
||||
self.overwrite_organization,
|
||||
install_packages,
|
||||
install_pakages,
|
||||
)
|
||||
kwargs["dockerfile"].write_text(rendered + "\n")
|
||||
|
||||
@ -638,8 +638,8 @@ class ImagesInfo:
|
||||
|
||||
def parse_args():
|
||||
stages = ["build", "remove_dockerfiles", "render_dockerfiles", "push"]
|
||||
arches = ["amd64", "386", "arm64"]
|
||||
branches = ["p10", "sisyphus", "c10f1", "c10f2"]
|
||||
arches = ["amd64", "386", "arm64", "arm", "ppc64le"]
|
||||
branches = ["p9", "p10", "sisyphus", "c10f1", "c10f2"]
|
||||
organizations = list(ORG_DIR.iterdir())
|
||||
images = [f"{o.name}/{i.name}" for o in organizations for i in o.iterdir()]
|
||||
organizations = [o.name for o in organizations]
|
||||
@ -654,8 +654,7 @@ def parse_args():
|
||||
nargs="+",
|
||||
default=images,
|
||||
choices=images,
|
||||
metavar="IMAGE_NAME",
|
||||
help="list of images to build",
|
||||
help="list of branches",
|
||||
)
|
||||
images_group.add_argument(
|
||||
"-o",
|
||||
@ -665,14 +664,6 @@ def parse_args():
|
||||
choices=organizations,
|
||||
help="build all images from these organizations",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--skip-images",
|
||||
nargs="+",
|
||||
default=[],
|
||||
choices=images,
|
||||
metavar="IMAGE_NAME",
|
||||
help="list of images to skip",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-r",
|
||||
"--registry",
|
||||
@ -705,20 +696,27 @@ def parse_args():
|
||||
parser.add_argument(
|
||||
"--sign",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--skip-images",
|
||||
nargs="+",
|
||||
default=[],
|
||||
choices=images,
|
||||
help="list of skipping images",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-a",
|
||||
"--arches",
|
||||
nargs="+",
|
||||
default=arches,
|
||||
choices=arches,
|
||||
help="build images for these architectures",
|
||||
help="list of arches",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--skip-arches",
|
||||
nargs="+",
|
||||
default=[],
|
||||
choices=arches,
|
||||
help="list of architectures to skip",
|
||||
help="list of skipping arches",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-b",
|
||||
@ -726,28 +724,28 @@ def parse_args():
|
||||
nargs="+",
|
||||
default=branches,
|
||||
choices=branches,
|
||||
help="build images for these branches",
|
||||
help="list of branches",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--skip-branches",
|
||||
nargs="+",
|
||||
default=[],
|
||||
choices=branches,
|
||||
help="list of branches to skip",
|
||||
help="list of skipping branches",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--stages",
|
||||
nargs="+",
|
||||
default=stages,
|
||||
choices=stages,
|
||||
help="list of stages to go through",
|
||||
help="list of stages",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--skip-stages",
|
||||
nargs="+",
|
||||
default=[],
|
||||
choices=stages,
|
||||
help="list of stages to skip",
|
||||
help="list of skipping stages",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
|
@ -8,7 +8,7 @@ LABEL org.opencontainers.image.source="http://httpd.apache.org"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
|
||||
{{ install_packages("apache2") }}
|
||||
{{ install_pakages("apache2") }}
|
||||
|
||||
EXPOSE 80
|
||||
|
1
org/alt/apache2/test
Normal file
1
org/alt/apache2/test
Normal file
@ -0,0 +1 @@
|
||||
apachectl -v
|
@ -2,6 +2,6 @@ FROM {{ registry }}{{ alt_image }}:{{ branch }}
|
||||
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
{{ install_packages("glibc-gconv-modules", "glibc-locales", "tzdata") }}
|
||||
{{ install_pakages("glibc-gconv-modules", "glibc-locales", "tzdata") }}
|
||||
|
||||
CMD ["bash"]
|
1
org/alt/base/test
Normal file
1
org/alt/base/test
Normal file
@ -0,0 +1 @@
|
||||
LC_ALL=ru_RU.UTF-8 TZ=/usr/share/zoneinfo/Europe/Moscow date| grep MSK
|
@ -6,7 +6,7 @@ LABEL org.opencontainers.image.title="buildpack-deps-curl"
|
||||
LABEL org.opencontainers.image.licenses="GPLv2"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
|
||||
{{ install_packages(
|
||||
{{ install_pakages(
|
||||
"ca-certificates",
|
||||
"curl",
|
||||
"gnupg",
|
1
org/alt/buildpack-deps-curl/test
Normal file
1
org/alt/buildpack-deps-curl/test
Normal file
@ -0,0 +1 @@
|
||||
curl --version && gpg --version
|
@ -6,7 +6,7 @@ LABEL org.opencontainers.image.title="buildpack-deps-scm"
|
||||
LABEL org.opencontainers.image.licenses="GPLv2"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
|
||||
{{ install_packages(
|
||||
{{ install_pakages(
|
||||
"git",
|
||||
"mercurial",
|
||||
"openssh-clients",
|
1
org/alt/buildpack-deps-scm/test
Normal file
1
org/alt/buildpack-deps-scm/test
Normal file
@ -0,0 +1 @@
|
||||
git --version && hg --version
|
@ -6,7 +6,7 @@ LABEL org.opencontainers.image.title="buildpack-deps"
|
||||
LABEL org.opencontainers.image.licenses="GPLv2"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
|
||||
{{ install_packages(
|
||||
{{ install_pakages(
|
||||
"ImageMagick",
|
||||
"autoconf",
|
||||
"automake",
|
1
org/alt/buildpack-deps/test
Normal file
1
org/alt/buildpack-deps/test
Normal file
@ -0,0 +1 @@
|
||||
gcc --version && make --version
|
@ -8,27 +8,27 @@ LABEL org.opencontainers.image.licenses="GPLv2"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
|
||||
# install editor
|
||||
{{ install_packages("vim-console") }}
|
||||
{{ install_pakages("vim-console") }}
|
||||
|
||||
# install debugging tools
|
||||
{{ install_packages("strace", "gdb") }}
|
||||
{{ install_pakages("strace", "gdb") }}
|
||||
|
||||
# install document viewers
|
||||
{{ install_packages("man") }}
|
||||
{{ install_pakages("man") }}
|
||||
|
||||
# install version control system
|
||||
{{ install_packages("git-core", "perl-Git") }}
|
||||
{{ install_pakages("git-core", "perl-Git") }}
|
||||
|
||||
# install network utils
|
||||
{{ install_packages("iproute2", "iputils", "wget", "curl") }}
|
||||
{{ install_pakages("iproute2", "iputils", "wget", "curl") }}
|
||||
|
||||
# install file utils
|
||||
{{ install_packages("lsof", "ripgrep") }}
|
||||
{{ install_pakages("lsof", "ripgrep") }}
|
||||
|
||||
# install shell and completions
|
||||
{{ install_packages("zsh", "zsh-completions") }}
|
||||
{{ install_pakages("zsh", "zsh-completions") }}
|
||||
|
||||
# install compilation utils
|
||||
{{ install_packages("make", "gcc", "gcc-c++") }}
|
||||
{{ install_pakages("make", "gcc", "gcc-c++") }}
|
||||
|
||||
CMD ["zsh"]
|
@ -3,13 +3,13 @@ FROM {{ registry }}{{ alt_image }}:{{ branch }}
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
LABEL org.opencontainers.image.title="distroless-builder"
|
||||
LABEL org.opencontainers.image.description="This image is used to build tarballs for distroless images"
|
||||
LABEL org.opencontainers.image.description="This images is using to build tarball for distroless images"
|
||||
LABEL org.opencontainers.image.licenses="GPLv2"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
|
||||
RUN echo %_excludedocs 1 >> /etc/rpm/macros
|
||||
RUN rpm -qalds | awk '/^normal/{print $2}' | xargs rm -rf
|
||||
{{ install_packages("python3", "glibc-utils", "apt-repo") }}
|
||||
{{ install_pakages("python3", "glibc-utils", "apt-repo") }}
|
||||
WORKDIR /usr/src/distroless
|
||||
RUN mkdir file-lists
|
||||
RUN useradd -m nonroot
|
3
org/alt/distroless-builder/README.md
Normal file
3
org/alt/distroless-builder/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
ALT dockerfile for distroless-builder image.
|
||||
|
||||
This images is using to build tarball for distroless images.
|
1
org/alt/distroless-builder/test
Normal file
1
org/alt/distroless-builder/test
Normal file
@ -0,0 +1 @@
|
||||
apt-repo --version
|
1
org/alt/distroless-devel/test
Normal file
1
org/alt/distroless-devel/test
Normal file
@ -0,0 +1 @@
|
||||
ss -V
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user