Add workflow to publish container images on github

Note that variable expansion in --from and FROM was working oddly,
see: https://github.com/docker/cli/issues/3356#issuecomment-957892224
for context.
This commit is contained in:
William Douglas
2024-06-13 15:43:04 -07:00
committed by William Douglas
parent a4c1b74808
commit 114295de66
25 changed files with 226 additions and 88 deletions

26
.github/workflows/release.yaml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Dockerfiles Release
on: [create]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
release:
if: (github.event_name == 'create' && github.event.ref_type == 'tag')
name: Release
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
run: ./build-and-push-images.sh ${{ github.event.ref }}

54
build-and-push-images.sh Executable file
View File

@@ -0,0 +1,54 @@
#!/bin/bash
set -eu -o pipefail
create_image() {
local name="$1"
local ver="$2"
pushd "${name}"
docker build -t ghcr.io/clearlinux/"${name}":"${ver}" . --build-arg="clear_ver=${ver}"
popd
}
push_image() {
local name="$1"
local ver="$2"
docker push ghcr.io/clearlinux/"${name}":"${ver}"
}
build_and_push_image() {
local name="$1"
local ver="$2"
create_image "${name}" "${ver}"
push_image "${name}" "${ver}"
}
main() {
local ver="$1"
build_and_push_image os-core "${ver}"
build_and_push_image clr-installer-ci "${ver}"
# httpd is used by cgit so it must be pushed first
build_and_push_image httpd "${ver}"
build_and_push_image cgit "${ver}"
build_and_push_image golang "${ver}"
build_and_push_image haproxy "${ver}"
build_and_push_image iperf "${ver}"
build_and_push_image mariadb "${ver}"
build_and_push_image memcached "${ver}"
build_and_push_image mixer-ci "${ver}"
build_and_push_image nginx "${ver}"
build_and_push_image node "${ver}"
build_and_push_image numpy-mp "${ver}"
build_and_push_image perl "${ver}"
build_and_push_image php "${ver}"
build_and_push_image php-fpm "${ver}"
build_and_push_image postgres "${ver}"
build_and_push_image python "${ver}"
build_and_push_image rabbitmq "${ver}"
build_and_push_image r-base "${ver}"
build_and_push_image redis "${ver}"
build_and_push_image ruby "${ver}"
build_and_push_image tesseract-ocr "${ver}"
}
main $1

View File

@@ -1,10 +1,13 @@
ARG clear_ver
FROM ghcr.io/clearlinux/httpd:$clear_ver AS httpd
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
@@ -23,11 +26,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/httpd:latest / /os_core_install/
COPY --from=httpd / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/httpd:latest
FROM httpd
COPY --from=builder /install_root /
COPY cgitrc /etc/cgitrc

View File

@@ -68,7 +68,7 @@ function do_tag {
local image=$1
local pkg=$2
local base=$3
echo "=> Tagging the $image"
local tag=$(get_tag $pkg)

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,11 +26,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,12 +26,12 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,11 +26,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,12 +26,12 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,15 +1,18 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest as builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -24,11 +27,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,11 +26,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,11 +26,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /
COPY default.conf /etc/nginx-mainline/conf.d/default.conf

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,12 +26,12 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,11 +26,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,9 +1,10 @@
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Install clean os-core bundle in target directory
# using the new os version

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,14 +26,14 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /
WORKDIR /root
CMD ["perl5.28.2","-de0"]
CMD ["perl","-de0"]

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,12 +26,12 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,16 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -32,11 +34,11 @@ opcache.revalidate_freq=${OPCACHE_REVALIDATE_FREQ}' >> /install_root/usr/share/d
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
ENV OPCACHE_REVALIDATE_FREQ=0 \
OPCACHE_VALIDATE_TIMESTAMPS=0 \

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,11 +26,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /
@@ -42,8 +45,7 @@ RUN sed -i "s|#listen_addresses.*|listen_addresses = '*'|" /usr/share/postgresql
VOLUME /var/lib/pgsql/data
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
ln -s /usr/local/bin/docker-entrypoint.sh / && \
ln -s /usr/share/postgresql11 /usr/share/postgresql
ln -s /usr/local/bin/docker-entrypoint.sh /
ENTRYPOINT ["docker-entrypoint.sh"]

View File

@@ -34,9 +34,9 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"
mkdir -p /var/run/postgresql11
chown -R postgres /var/run/postgresql11
chmod 775 /var/run/postgresql11
mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod 775 /var/run/postgresql
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
if [ "$POSTGRES_INITDB_WALDIR" ]; then

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,12 +26,12 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
ENV NAME="clearlinux-python"
COPY --from=builder /install_root /

View File

@@ -1,15 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -24,12 +26,12 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,11 +26,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,11 +26,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,11 +26,11 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /

View File

@@ -1,14 +1,17 @@
ARG clear_ver
FROM ghcr.io/clearlinux/os-core:$clear_ver AS core
FROM clearlinux:latest AS builder
ARG clear_ver
ARG swupd_args
# Move to latest Clear Linux release to ensure
# that the swupd command line arguments are
# correct
RUN swupd update --no-boot-update $swupd_args
RUN swupd update --no-boot-update -V $clear_ver $swupd_args
# Grab os-release info from the minimal base image so
# that the new content matches the exact OS version
COPY --from=clearlinux/os-core:latest /usr/lib/os-release /
COPY --from=core /usr/lib/os-release /
# Install additional content in a target directory
# using the os version from the minimal base
@@ -23,12 +26,12 @@ RUN source /os-release && \
# file exists on different layers. To minimize docker
# image size, remove the overlapped files before copy.
RUN mkdir /os_core_install
COPY --from=clearlinux/os-core:latest / /os_core_install/
COPY --from=core / /os_core_install/
RUN cd / && \
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d &> /dev/null || true
FROM clearlinux/os-core:latest
FROM core
COPY --from=builder /install_root /