0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-31 19:08:59 +01:00

Docker: Enable buildkit; postfix tags with target. [ci skip]

This commit is contained in:
Jason Volk 2022-07-29 17:47:20 -07:00
parent a2197e87df
commit 3139050e45
6 changed files with 38 additions and 35 deletions

View file

@ -8,12 +8,6 @@
[![](https://img.shields.io/badge/github-source-8891CD.svg?logo=GitHub&style=for-the-badge)](https://github.com/matrix-construct/construct) [![](https://img.shields.io/badge/docker-images-8891CD.svg?logo=Docker&style=for-the-badge)](https://registry.hub.docker.com/r/jevolk/construct)
| | |
|:---:|:---|
| [![](https://img.shields.io/docker/image-size/jevolk/construct/alpine-3.16-base-built.svg?label=alpine3.16-mini&logo=Docker&style=flat-square&color=5965AF&logoWidth=38)](https://registry.hub.docker.com/r/jevolk/construct/tags) | `docker pull jevolk/construct:alpine-3.16-base-built` |
| [![](https://img.shields.io/docker/image-size/jevolk/construct/alpine-3.16-full-built.svg?label=alpine-3.16-full&logo=Docker&style=flat-square&color=5965AF&logoWidth=32)](https://registry.hub.docker.com/r/jevolk/construct/tags) | `docker pull jevolk/construct:alpine-3.16-full-built` |
| [![](https://img.shields.io/docker/image-size/jevolk/construct/ubuntu-22.04-built.svg?label=ubuntu-22.04&logo=Docker&style=flat-square&color=5965AF&logoWidth=46)](https://registry.hub.docker.com/r/jevolk/construct/tags) | `docker pull jevolk/construct:ubuntu-22.04-built` |
- `git clone https://github.com/matrix-construct/construct`
[![](https://img.shields.io/github/repo-size/matrix-construct/construct.svg?logo=GitHub&style=flat-square&color=5965AF)](https://github.com/matrix-construct/construct)
@ -21,6 +15,11 @@
[![](https://img.shields.io/github/directory-file-count/matrix-construct/construct.svg?type=dir&label=directories&logo=GitHub&style=flat-square&color=5965AF)](https://github.com/matrix-construct/construct)
[![](https://img.shields.io/github/directory-file-count/matrix-construct/construct.svg?type=file&label=files&logo=GitHub&style=flat-square&color=5965AF)](https://github.com/matrix-construct/construct)
| Fully Featured Builds | Minimal Dependencies |
|:---|:---|
| [![](https://img.shields.io/docker/image-size/jevolk/construct/alpine-3.16-full-built-clang-amd64.svg?logoWidth=25&label=alpine%203.16%20clang%20amd64&logo=Docker&style=flat-square&color=5965AF)](https://registry.hub.docker.com/r/jevolk/construct/tags) | [![](https://img.shields.io/docker/image-size/jevolk/construct/alpine-3.16-base-built-clang-amd64.svg?logoWidth=25&label=alpine%203.16%20clang%20amd64&logo=Docker&style=flat-square&color=5965AF)](https://registry.hub.docker.com/r/jevolk/construct/tags)
| [![](https://img.shields.io/docker/image-size/jevolk/construct/alpine-3.16-full-built-gcc-amd64.svg?logoWidth=25&label=alpine%203.16%20gcc%20amd64&logo=Docker&style=flat-square&color=5965AF)](https://registry.hub.docker.com/r/jevolk/construct/tags) | [![](https://img.shields.io/docker/image-size/jevolk/construct/alpine-3.16-base-built-gcc-amd64.svg?logoWidth=25&label=alpine%203.16%20gcc%20amd64&logo=Docker&style=flat-square&color=5965AF)](https://registry.hub.docker.com/r/jevolk/construct/tags)
| [![](https://img.shields.io/docker/image-size/jevolk/construct/ubuntu-22.04-built.svg?logoWidth=25&label=ubuntu%2022.04%20amd64&logo=Docker&style=flat-square&color=5965AF)](https://registry.hub.docker.com/r/jevolk/construct/tags) | |
### 🗒️ INSTRUCTIONS

View file

@ -1,4 +1,4 @@
FROM alpine:3.16.1
FROM --platform=$TARGETPLATFORM alpine:3.16.1
ENV packages="\
boost-chrono \

View file

@ -2,7 +2,7 @@ ARG acct
ARG repo
ARG feature
FROM ${acct}/${repo}:alpine-3.16-${feature}
FROM ${acct}/${repo}:alpine-3.16-${feature}-${TARGETARCH}
ARG cc
ARG cxx

View file

@ -1,7 +1,7 @@
ARG acct
ARG repo
FROM ${acct}/${repo}:alpine-3.16-base
FROM ${acct}/${repo}:alpine-3.16-base-${TARGETARCH}
ENV packages="\
freetype \

View file

@ -3,7 +3,7 @@ ARG repo
ARG feature
ARG cc
FROM ${acct}/${repo}:alpine-3.16-${feature}-built-${cc}
FROM ${acct}/${repo}:alpine-3.16-${feature}-built-${cc}-${TARGETARCH}
ENV ircd_mods_unload_check=false
WORKDIR /root

View file

@ -9,6 +9,9 @@ ARGS_="$ARGS_ --compress=true"
ARGS_="$ARGS_ --build-arg acct=$ACCT"
ARGS_="$ARGS_ --build-arg repo=$REPO"
export DOCKER_BUILDKIT=1
#export BUILDKIT_PROGRESS=plain
###############################################################################
#
# Alpine 3.16
@ -19,91 +22,92 @@ ARGS_="$ARGS_ --build-arg repo=$REPO"
#
ARGS="$ARGS_"
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base $BASEDIR/alpine/3.16/base
ARGS="$ARGS --platform linux/amd64"
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-amd64 $BASEDIR/alpine/3.16/base
#
# L1 - Fully featured image
#
ARGS="$ARGS_"
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full $BASEDIR/alpine/3.16/full
ARGS="$ARGS --platform linux/amd64"
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-amd64 $BASEDIR/alpine/3.16/full
#
# L3 - Built images
# L2 - Built images
#
ARGS="$ARGS_"
ARGS="$ARGS --platform linux/amd64"
ARGS="$ARGS --build-arg feature=base"
ARGS="$ARGS --build-arg extra_packages_dev=gcc"
ARGS="$ARGS --build-arg extra_packages_dev1=g++"
ARGS="$ARGS --build-arg cc=gcc --build-arg cxx=g++"
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-built-gcc $BASEDIR/alpine/3.16/built
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-built-gcc-amd64 $BASEDIR/alpine/3.16/built
ARGS="$ARGS_"
ARGS="$ARGS --platform linux/amd64"
ARGS="$ARGS --build-arg feature=base"
ARGS="$ARGS --build-arg extra_packages_dev=clang"
ARGS="$ARGS --build-arg extra_packages_dev1=llvm"
ARGS="$ARGS --build-arg extra_packages_dev2=llvm-dev"
ARGS="$ARGS --build-arg cc=clang --build-arg cxx=clang++"
ARGS="$ARGS -t $ACCT/$REPO:alpine-3.16-base-built"
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-built-clang $BASEDIR/alpine/3.16/built
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-built-clang-amd64 $BASEDIR/alpine/3.16/built
ARGS="$ARGS_"
ARGS="$ARGS --platform linux/amd64"
ARGS="$ARGS --build-arg feature=full"
ARGS="$ARGS --build-arg extra_packages_dev=gcc"
ARGS="$ARGS --build-arg extra_packages_dev1=g++"
ARGS="$ARGS --build-arg cc=gcc --build-arg cxx=g++"
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-built-gcc $BASEDIR/alpine/3.16/built
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-built-gcc-amd64 $BASEDIR/alpine/3.16/built
ARGS="$ARGS_"
ARGS="$ARGS --platform linux/amd64"
ARGS="$ARGS --build-arg feature=full"
ARGS="$ARGS --build-arg extra_packages_dev=clang"
ARGS="$ARGS --build-arg extra_packages_dev1=llvm"
ARGS="$ARGS --build-arg extra_packages_dev2=llvm-dev"
ARGS="$ARGS --build-arg cc=clang --build-arg cxx=clang++"
ARGS="$ARGS -t $ACCT/$REPO:alpine-3.16-full-built"
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-built-clang $BASEDIR/alpine/3.16/built
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-built-clang-amd64 $BASEDIR/alpine/3.16/built
#
# L4 - Test images
# L3 - Test images
#
ARGS="$ARGS_"
ARGS="$ARGS --platform linux/amd64"
ARGS="$ARGS --build-arg feature=base"
ARGS="$ARGS --build-arg cc=gcc --build-arg cxx=g++"
#docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-test-gcc $BASEDIR/alpine/3.16/test
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-test-gcc-amd64 $BASEDIR/alpine/3.16/test
ARGS="$ARGS_"
ARGS="$ARGS --platform linux/amd64"
ARGS="$ARGS --build-arg feature=base"
ARGS="$ARGS --build-arg cc=clang --build-arg cxx=clang++"
#docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-test-clang $BASEDIR/alpine/3.16/test
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-base-test-clang-amd64 $BASEDIR/alpine/3.16/test
ARGS="$ARGS_"
ARGS="$ARGS --platform linux/amd64"
ARGS="$ARGS --build-arg feature=full"
ARGS="$ARGS --build-arg cc=gcc --build-arg cxx=g++"
ARGS="$ARGS -t $ACCT/$REPO:alpine-3.16-full-test"
#docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-test-gcc $BASEDIR/alpine/3.16/test
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-test-gcc-amd64 $BASEDIR/alpine/3.16/test
ARGS="$ARGS_"
ARGS="$ARGS --platform linux/amd64"
ARGS="$ARGS --build-arg feature=full"
ARGS="$ARGS --build-arg cc=clang --build-arg cxx=clang++"
#docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-test-clang $BASEDIR/alpine/3.16/test
docker build $ARGS -t $ACCT/$REPO:alpine-3.16-full-test-clang-amd64 $BASEDIR/alpine/3.16/test
#
# Pushed images
#
#docker push $ACCT/$REPO:alpine-3.16-base
#docker push $ACCT/$REPO:alpine-3.16-base-dev
docker push $ACCT/$REPO:alpine-3.16-base-built-gcc
docker push $ACCT/$REPO:alpine-3.16-base-built-clang
docker push $ACCT/$REPO:alpine-3.16-base-built
docker push $ACCT/$REPO:alpine-3.16-base-built-gcc-amd64
docker push $ACCT/$REPO:alpine-3.16-base-built-clang-amd64
#docker push $ACCT/$REPO:alpine-3.16-full
#docker push $ACCT/$REPO:alpine-3.16-full-dev
docker push $ACCT/$REPO:alpine-3.16-full-built-gcc
docker push $ACCT/$REPO:alpine-3.16-full-built-clang
docker push $ACCT/$REPO:alpine-3.16-full-built
docker push $ACCT/$REPO:alpine-3.16-full-built-gcc-amd64
docker push $ACCT/$REPO:alpine-3.16-full-built-clang-amd64
###############################################################################
#