diff --git a/Jenkinsfile b/Jenkinsfile index f0e0947d..02ad6721 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { } axis { name 'GO_FOLDER' - values 'go1.14', 'go1.15', 'go1.16' + values 'go1.16' } axis { name 'PLATFORM' diff --git a/README.md b/README.md index 427dd1c0..55e12ec4 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,17 @@ The base image used is Debian 9 (stretch) unless otherwise specified. ## Build Tags - `1.10.8-main`, `1.11.13-main`, `1.12.12-main`, `1.13.12-main`, `1.14.15-main`, `1.15.10-main`, `1.16.4-main` - linux/{amd64,386} and windows/{amd64,386} -- `1.10.8-arm`, `1.11.13-arm`, `1.12.12-arm`, `1.13.12-arm`, `1.14.15-arm`, `1.15.10-arm`, `1.16.4-arm` - linux/{armv5,armv6,armv7,arm64} +- `1.10.8-arm`, `1.11.13-arm`, `1.12.12-arm`, `1.13.12-arm`, `1.14.15-arm`, `1.15.10-arm` +- linux/{armv5,armv6,armv7,arm64} +- `1.16.4-arm` - linux/{arm64} +- `1.16.4-armel` - linux/{armv5,armv6} +- `1.16.4-armhf` - linux/{armv7} - `1.10.8-darwin`, `1.11.13-darwin`, `1.12.12-darwin`, `1.13.12-darwin`, `1.14.15-darwin`, `1.16.4-darwin` - darwin/{386} - `1.10.8-darwin`, `1.11.13-darwin`, `1.12.12-darwin`, `1.13.12-darwin`, `1.14.15-darwin`, `1.15.10-darwin`, `1.16.4-darwin` - darwin/{amd64} - `1.10.8-ppc`, `1.11.13-ppc`, `1.12.12-ppc`, `1.13.12-ppc`, `1.14.15-ppc`, `1.15.10-ppc`, `1.16.4-ppc` - linux/{ppc64,ppc64le} -- `1.10.8-mips`, `1.11.13-mips`, `1.12.12-mips`, `1.13.12-mips`, `1.14.15-mips`, `1.15.10-mips`, `1.16.4-mips` - linux/{mips,mipsle,mips64,mips64le} +- `1.10.8-mips`, `1.11.13-mips`, `1.12.12-mips`, `1.13.12-mips`, `1.14.15-mips`, `1.15.10-mips` - linux/{mips,mipsle,mips64,mips64le} +- `1.16.4-mips` - linux/{mips64,mips64le} +- `1.16.4-mips32` - linux/{mips,mipsle} - `1.10.8-s390x`, `1.11.13-s390x`, `1.12.12-s390`, `1.13.12-s390`, `1.14.15-s390`, `1.15.10-s390`, `1.16.4-s390` - linux/s390x - `1.10.8-main-debian7`, `1.11.13-main-debian7`, `1.12.12-debian7`, `1.13.12-debian7`, `1.14.15-debian7`, `1.15.10-debian7`, `1.16.4-debian7` - linux/{amd64,386} and windows/{amd64,386} (Debian 7 uses glibc 2.13 so the resulting binaries (if dynamically linked) have greater diff --git a/go1.16/Makefile b/go1.16/Makefile index 0b535e1b..c016e6c5 100644 --- a/go1.16/Makefile +++ b/go1.16/Makefile @@ -1,4 +1,4 @@ -IMAGES := base main darwin arm mips ppc s390x +IMAGES := base main darwin arm armhf armel mips mips32 ppc s390x ARM_IMAGES := base-arm build: diff --git a/go1.16/Makefile.debian10 b/go1.16/Makefile.debian10 index 04126feb..479b70e7 100644 --- a/go1.16/Makefile.debian10 +++ b/go1.16/Makefile.debian10 @@ -1,4 +1,4 @@ -IMAGES := base main darwin +IMAGES := base arm armhf armel mips mips32 ppc s390x darwin main DEBIAN_VERSION := 10 TAG_EXTENSION := -debian10 diff --git a/go1.16/Makefile.debian9 b/go1.16/Makefile.debian9 index 2d03faed..acc9dc87 100644 --- a/go1.16/Makefile.debian9 +++ b/go1.16/Makefile.debian9 @@ -1,4 +1,4 @@ -IMAGES := base main arm darwin mips ppc s390x +IMAGES := base main darwin arm armhf armel mips mips32 ppc s390x ARM_IMAGES := base-arm DEBIAN_VERSION := 9 TAG_EXTENSION := -debian9 diff --git a/go1.16/arm/Dockerfile.tmpl b/go1.16/arm/Dockerfile.tmpl index b4cedcf7..ba15eb55 100644 --- a/go1.16/arm/Dockerfile.tmpl +++ b/go1.16/arm/Dockerfile.tmpl @@ -3,36 +3,50 @@ ARG VERSION ARG TAG_EXTENSION='' FROM ${REPOSITORY}/golang-crossbuild:${VERSION}-base${TAG_EXTENSION} -RUN \ - dpkg --add-architecture arm64 \ - && apt-get update -qq \ - && apt-get install -qq -y \ - --no-install-recommends \ - --allow-unauthenticated \ +RUN dpkg --add-architecture arm64 \ + && apt update -y --no-install-recommends \ + && apt upgrade -y --no-install-recommends \ + && apt full-upgrade -y --no-install-recommends \ + && apt install -qq -y --no-install-recommends \ crossbuild-essential-arm64 \ - crossbuild-essential-armel \ - crossbuild-essential-armhf \ - linux-libc-dev-arm64-cross \ - linux-libc-dev-armel-cross \ - linux-libc-dev-armhf-cross \ - librpm-dev:arm64 \ + linux-libc-dev-arm64-cross + +RUN apt install -qq -y \ libc-dev:arm64 \ libpopt-dev:arm64 \ - linux-libc-dev:arm64 \ - libxml2-dev:arm64 \ - libxml2:arm64 \ - libicu-dev:arm64 \ - libicu57:arm64 \ - icu-devtools:arm64 \ - libsystemd-dev:arm64 \ - librpm3:arm64 \ + linux-libc-dev:arm64 + +{{if eq .DEBIAN_VERSION "9"}} +# librpm-dev +RUN apt install -y \ + librpm-dev:arm64 \ + librpm3:arm64 \ librpmio3:arm64 \ librpmbuild3:arm64 \ librpmsign3:arm64 \ + libxml2-dev:arm64 \ libsqlite3-dev:arm64 \ libnss3:arm64 \ libsqlite3-0:arm64 \ - && rm -rf /var/lib/apt/lists/* + libxml2:arm64 \ + libsqlite3-0:arm64 + +# libsystemd-dev +RUN apt install -y \ + libsystemd-dev:arm64 libsystemd0:arm64 liblz4-1:arm64 +{{ end }} + +{{if eq .DEBIAN_VERSION "10"}} +# librpm-dev +RUN apt install -y \ + librpm-dev:arm64 + +# libsystemd-dev +RUN apt install -y \ + libsystemd-dev:arm64 +{{ end }} + +RUN rm -rf /var/lib/apt/lists/* COPY rootfs / diff --git a/go1.16/arm/rootfs/compilers.yaml b/go1.16/arm/rootfs/compilers.yaml index 6269add7..80fab65d 100644 --- a/go1.16/arm/rootfs/compilers.yaml +++ b/go1.16/arm/rootfs/compilers.yaml @@ -1,17 +1,6 @@ --- linux: - armv7: - CC: arm-linux-gnueabihf-gcc - CXX: arm-linux-gnueabihf-g++ - armv6: - # Using debian armel for ARMv6. - # This is the same as ARMv5 so it will use softfp instead of hardfp. - CC: arm-linux-gnueabi-gcc - CXX: arm-linux-gnueabi-g++ - armv5: - CC: arm-linux-gnueabi-gcc - CXX: arm-linux-gnueabi-g++ arm64: CC: aarch64-linux-gnu-gcc CXX: aarch64-linux-gnu-g++ diff --git a/go1.16/armel/.dockerignore b/go1.16/armel/.dockerignore new file mode 100644 index 00000000..f3c7a7c5 --- /dev/null +++ b/go1.16/armel/.dockerignore @@ -0,0 +1 @@ +Makefile diff --git a/go1.16/armel/Dockerfile.tmpl b/go1.16/armel/Dockerfile.tmpl new file mode 100644 index 00000000..e7b246df --- /dev/null +++ b/go1.16/armel/Dockerfile.tmpl @@ -0,0 +1,70 @@ +ARG REPOSITORY +ARG VERSION +ARG TAG_EXTENSION='' +FROM ${REPOSITORY}/golang-crossbuild:${VERSION}-base${TAG_EXTENSION} + +RUN dpkg --add-architecture armel \ + && apt update -y --no-install-recommends \ + && apt upgrade -y --no-install-recommends \ + && apt full-upgrade -y --no-install-recommends \ + && apt install -qq -y --no-install-recommends \ + crossbuild-essential-armel \ + linux-libc-dev-armel-cross + +RUN apt install -qq -y \ + libc-dev:armel \ + libpopt-dev:armel \ + linux-libc-dev:armel + +{{if eq .DEBIAN_VERSION "9"}} +# librpm-dev +RUN apt install -y \ + librpm-dev:armel \ + librpm3:armel \ + librpmio3:armel \ + librpmbuild3:armel \ + librpmsign3:armel \ + libxml2-dev:armel \ + libsqlite3-dev:armel \ + libnss3:armel \ + libsqlite3-0:armel \ + libxml2:armel \ + libsqlite3-0:armel + +# libsystemd-dev +RUN apt install -y \ + libsystemd-dev:armel libsystemd0:armel liblz4-1:armel +{{ end }} + +{{if eq .DEBIAN_VERSION "10"}} +# librpm-dev +RUN apt install -y \ + librpm-dev:armel + +# libsystemd-dev +RUN apt install -y \ + libsystemd-dev:armel +{{ end }} + +RUN rm -rf /var/lib/apt/lists/* + +COPY rootfs / + +# Basic test +RUN cd / \ + && arm-linux-gnueabi-gcc helloWorld.c -o helloWorld \ + && file helloWorld \ + && readelf -h helloWorld \ + && file helloWorld | cut -d "," -f 3 | grep -c 'EABI'\ + && rm helloWorld.c helloWorld + +# Build-time metadata as defined at http://label-schema.org. +ARG BUILD_DATE +ARG IMAGE +ARG VCS_REF +ARG VCS_URL +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$IMAGE \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url=$VCS_URL \ + org.label-schema.schema-version="1.0" diff --git a/go1.16/armel/Makefile b/go1.16/armel/Makefile new file mode 100644 index 00000000..0a42375f --- /dev/null +++ b/go1.16/armel/Makefile @@ -0,0 +1 @@ +include ../Makefile.common diff --git a/go1.16/armel/rootfs/compilers.yaml b/go1.16/armel/rootfs/compilers.yaml new file mode 100644 index 00000000..7fe88894 --- /dev/null +++ b/go1.16/armel/rootfs/compilers.yaml @@ -0,0 +1,11 @@ +--- + +linux: + armv6: + # Using debian armel for ARMv6. + # This is the same as ARMv5 so it will use softfp instead of hardfp. + CC: arm-linux-gnueabi-gcc + CXX: arm-linux-gnueabi-g++ + armv5: + CC: arm-linux-gnueabi-gcc + CXX: arm-linux-gnueabi-g++ diff --git a/go1.16/armel/rootfs/helloWorld.c b/go1.16/armel/rootfs/helloWorld.c new file mode 100644 index 00000000..dcfb86bc --- /dev/null +++ b/go1.16/armel/rootfs/helloWorld.c @@ -0,0 +1,5 @@ +#include +int main() { + printf("Hello, World!"); + return 0; +} diff --git a/go1.16/armhf/.dockerignore b/go1.16/armhf/.dockerignore new file mode 100644 index 00000000..f3c7a7c5 --- /dev/null +++ b/go1.16/armhf/.dockerignore @@ -0,0 +1 @@ +Makefile diff --git a/go1.16/armhf/Dockerfile.tmpl b/go1.16/armhf/Dockerfile.tmpl new file mode 100644 index 00000000..03ce661a --- /dev/null +++ b/go1.16/armhf/Dockerfile.tmpl @@ -0,0 +1,70 @@ +ARG REPOSITORY +ARG VERSION +ARG TAG_EXTENSION='' +FROM ${REPOSITORY}/golang-crossbuild:${VERSION}-base${TAG_EXTENSION} + +RUN dpkg --add-architecture armhf \ + && apt update -y --no-install-recommends \ + && apt upgrade -y --no-install-recommends \ + && apt full-upgrade -y --no-install-recommends \ + && apt install -qq -y --no-install-recommends \ + crossbuild-essential-armhf \ + linux-libc-dev-armhf-cross + +RUN apt install -qq -y \ + libc-dev:armhf \ + libpopt-dev:armhf \ + linux-libc-dev:armhf + +{{if eq .DEBIAN_VERSION "9"}} +# librpm-dev +RUN apt install -y \ + librpm-dev:armhf \ + librpm3:armhf \ + librpmio3:armhf \ + librpmbuild3:armhf \ + librpmsign3:armhf \ + libxml2-dev:armhf \ + libsqlite3-dev:armhf \ + libnss3:armhf \ + libsqlite3-0:armhf \ + libxml2:armhf \ + libsqlite3-0:armhf + +# libsystemd-dev +RUN apt install -y \ + libsystemd-dev:armhf libsystemd0:armhf liblz4-1:armhf +{{ end }} + +{{if eq .DEBIAN_VERSION "10"}} +# librpm-dev +RUN apt install -y \ + librpm-dev:armhf + +# libsystemd-dev +RUN apt install -y \ + libsystemd-dev:armhf +{{ end }} + +RUN rm -rf /var/lib/apt/lists/* + +COPY rootfs / + +# Basic test +RUN cd / \ + && arm-linux-gnueabihf-gcc helloWorld.c -o helloWorld \ + && file helloWorld \ + && readelf -h helloWorld \ + && file helloWorld | cut -d "," -f 5 | grep -c 'armhf.so'\ + && rm helloWorld.c helloWorld + +# Build-time metadata as defined at http://label-schema.org. +ARG BUILD_DATE +ARG IMAGE +ARG VCS_REF +ARG VCS_URL +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$IMAGE \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url=$VCS_URL \ + org.label-schema.schema-version="1.0" diff --git a/go1.16/armhf/Makefile b/go1.16/armhf/Makefile new file mode 100644 index 00000000..0a42375f --- /dev/null +++ b/go1.16/armhf/Makefile @@ -0,0 +1 @@ +include ../Makefile.common diff --git a/go1.16/armhf/rootfs/compilers.yaml b/go1.16/armhf/rootfs/compilers.yaml new file mode 100644 index 00000000..0607a506 --- /dev/null +++ b/go1.16/armhf/rootfs/compilers.yaml @@ -0,0 +1,6 @@ +--- + +linux: + armv7: + CC: arm-linux-gnueabihf-gcc + CXX: arm-linux-gnueabihf-g++ diff --git a/go1.16/armhf/rootfs/helloWorld.c b/go1.16/armhf/rootfs/helloWorld.c new file mode 100644 index 00000000..dcfb86bc --- /dev/null +++ b/go1.16/armhf/rootfs/helloWorld.c @@ -0,0 +1,5 @@ +#include +int main() { + printf("Hello, World!"); + return 0; +} diff --git a/go1.16/base/Dockerfile.tmpl b/go1.16/base/Dockerfile.tmpl index f2a55d56..082016b9 100644 --- a/go1.16/base/Dockerfile.tmpl +++ b/go1.16/base/Dockerfile.tmpl @@ -5,10 +5,10 @@ ARG DEBIAN_VERSION # Replace sources.list in order to use archive.debian.org. COPY sources-debian${DEBIAN_VERSION}.list /etc/apt/sources.list -RUN \ - apt-get -o Acquire::Check-Valid-Until=false update \ - && apt-get dist-upgrade -y \ - && apt-get install -qq -y --no-install-recommends --allow-unauthenticated \ +RUN apt-get -o Acquire::Check-Valid-Until=false update -y --no-install-recommends --allow-unauthenticated \ + && apt-get upgrade -y --no-install-recommends --allow-unauthenticated \ + && apt-get dist-upgrade -y --no-install-recommends --allow-unauthenticated \ + && apt-get install -y --no-install-recommends --allow-unauthenticated \ build-essential \ ca-certificates \ curl \ diff --git a/go1.16/base/sources-debian10.list b/go1.16/base/sources-debian10.list index bff91789..74e7052a 100644 --- a/go1.16/base/sources-debian10.list +++ b/go1.16/base/sources-debian10.list @@ -1,2 +1,3 @@ +# see https://wiki.debian.org/CrossToolchains deb http://deb.debian.org/debian buster main -deb [arch=amd64,i386] http://security.debian.org/debian-security buster/updates main +deb http://security.debian.org/debian-security buster/updates main diff --git a/go1.16/base/sources-debian7.list b/go1.16/base/sources-debian7.list index 18c86e1e..7dac27a9 100644 --- a/go1.16/base/sources-debian7.list +++ b/go1.16/base/sources-debian7.list @@ -1,2 +1,4 @@ +# see https://wiki.debian.org/CrossToolchains +# https://bugs.launchpad.net/torios/+bug/1835529 deb http://archive.debian.org/debian wheezy main deb http://archive.debian.org/debian-security wheezy/updates main diff --git a/go1.16/base/sources-debian8.list b/go1.16/base/sources-debian8.list index 03a1b7fb..917d269d 100644 --- a/go1.16/base/sources-debian8.list +++ b/go1.16/base/sources-debian8.list @@ -1,2 +1,4 @@ +# see https://wiki.debian.org/CrossToolchains +# https://bugs.launchpad.net/torios/+bug/1835529 deb http://archive.debian.org/debian jessie main deb [arch=amd64,i386] http://security.debian.org/debian-security jessie/updates main diff --git a/go1.16/base/sources-debian9.list b/go1.16/base/sources-debian9.list index 449c0aa7..13c345ec 100644 --- a/go1.16/base/sources-debian9.list +++ b/go1.16/base/sources-debian9.list @@ -1,2 +1,3 @@ +# see https://wiki.debian.org/CrossToolchains deb http://deb.debian.org/debian stretch main -deb [arch=amd64,i386] http://security.debian.org/debian-security stretch/updates main +deb http://security.debian.org/debian-security stretch/updates main diff --git a/go1.16/mips/Dockerfile.tmpl b/go1.16/mips/Dockerfile.tmpl index 036ee196..113653dd 100644 --- a/go1.16/mips/Dockerfile.tmpl +++ b/go1.16/mips/Dockerfile.tmpl @@ -3,49 +3,75 @@ ARG VERSION ARG TAG_EXTENSION='' FROM ${REPOSITORY}/golang-crossbuild:${VERSION}-base${TAG_EXTENSION} -RUN apt-get update -RUN \ - dpkg --add-architecture mips64el \ - && apt-get -o Acquire::Check-Valid-Until=false update -qq \ - && apt-get install -qq -y \ - --no-install-recommends \ - --allow-unauthenticated \ +RUN dpkg --add-architecture mips64el \ + && apt update -y --no-install-recommends \ + && apt upgrade -y --no-install-recommends \ + && apt full-upgrade -y --no-install-recommends \ + && apt install -qq -y --no-install-recommends \ crossbuild-essential-mipsel \ - gcc-mips-linux-gnu \ - g++-mips-linux-gnu \ - gcc-6-mips64-linux-gnuabi64 \ - g++-6-mips64-linux-gnuabi64 \ - gcc-6-mips64el-linux-gnuabi64 \ - g++-6-mips64el-linux-gnuabi64 \ - librpm-dev:mips64el \ + gcc-mips64el-linux-gnuabi64 \ + g++-mips64el-linux-gnuabi64 \ + gcc-mips64-linux-gnuabi64 \ + g++-mips64-linux-gnuabi64 \ + linux-libc-dev-mips64el-cross + +RUN apt install -qq -y \ libc-dev:mips64el \ libpopt-dev:mips64el \ - linux-libc-dev:mips64el \ - libxml2-dev:mips64el \ - libxml2:mips64el \ - libicu-dev:mips64el \ - libicu57:mips64el \ - icu-devtools:mips64el \ - libsystemd-dev:mips64el \ + linux-libc-dev:mips64el + +{{ if eq .DEBIAN_VERSION "9" }} +# librpm-dev +RUN apt install -y \ + librpm-dev:mips64el \ librpm3:mips64el \ librpmio3:mips64el \ librpmbuild3:mips64el \ librpmsign3:mips64el \ + libxml2-dev:mips64el \ libsqlite3-dev:mips64el \ libnss3:mips64el \ libsqlite3-0:mips64el \ - && rm -rf /var/lib/apt/lists/* + libxml2:mips64el \ + libsqlite3-0:mips64el + +# libsystemd-dev +# RUN apt install -y \ +# libsystemd-dev:mips64el libsystemd0:mips64el liblz4-1:mips64el +{{ end }} + +{{if eq .DEBIAN_VERSION "10"}} +# librpm-dev +RUN apt install -y \ + librpm-dev:mips64el + +# libsystemd-dev +RUN apt install -y \ + libsystemd-dev:mips64el +{{ end }} + +RUN rm -rf /var/lib/apt/lists/* COPY rootfs / # Basic test RUN cd / \ - && mips64el-linux-gnuabi64-gcc-6 helloWorld.c -o helloWorld \ + && mips64el-linux-gnuabi64-gcc helloWorld.c -o helloWorld \ && file helloWorld \ && readelf -h helloWorld \ && readelf -h helloWorld | grep -c 'MIPS R3000' \ && readelf -h helloWorld | grep -c 'ELF64' \ && readelf -h helloWorld | grep -c "little endian" \ + && rm helloWorld + +# Basic test +RUN cd / \ + && mips64-linux-gnuabi64-gcc helloWorld.c -o helloWorld \ + && file helloWorld \ + && readelf -h helloWorld \ + && readelf -h helloWorld | grep -c 'MIPS R3000' \ + && readelf -h helloWorld | grep -c 'ELF64' \ + && readelf -h helloWorld | grep -c "big endian" \ && rm helloWorld.c helloWorld # Build-time metadata as defined at http://label-schema.org. diff --git a/go1.16/mips/rootfs/compilers.yaml b/go1.16/mips/rootfs/compilers.yaml index 7dff3130..15679ec3 100644 --- a/go1.16/mips/rootfs/compilers.yaml +++ b/go1.16/mips/rootfs/compilers.yaml @@ -1,15 +1,9 @@ --- linux: - mips: - CC: mips-linux-gnu-gcc - CXX: mips-linux-gnu-g++ - mipsle: - CC: mipsel-linux-gnu-gcc - CXX: mipsel-linux-gnu-g++ - mips64: - CC: mips64-linux-gnuabi64-gcc-6 - CXX: mips64-linux-gnuabi64-g++-6 mips64le: CC: mips64el-linux-gnuabi64-gcc-6 CXX: mips64el-linux-gnuabi64-g++-6 + mips64: + CC: mips64-linux-gnuabi64-gcc-6 + CXX: mips64-linux-gnuabi64-g++-6 diff --git a/go1.16/mips32/.dockerignore b/go1.16/mips32/.dockerignore new file mode 100644 index 00000000..f3c7a7c5 --- /dev/null +++ b/go1.16/mips32/.dockerignore @@ -0,0 +1 @@ +Makefile diff --git a/go1.16/mips32/Dockerfile.tmpl b/go1.16/mips32/Dockerfile.tmpl new file mode 100644 index 00000000..c76aecea --- /dev/null +++ b/go1.16/mips32/Dockerfile.tmpl @@ -0,0 +1,84 @@ +ARG REPOSITORY +ARG VERSION +ARG TAG_EXTENSION='' +FROM ${REPOSITORY}/golang-crossbuild:${VERSION}-base${TAG_EXTENSION} + +RUN dpkg --add-architecture mips \ + && apt update -y --no-install-recommends \ + && apt upgrade -y --no-install-recommends \ + && apt full-upgrade -y --no-install-recommends \ + && apt install -qq -y --no-install-recommends \ + crossbuild-essential-mipsel \ + gcc-mips-linux-gnu \ + g++-mips-linux-gnu \ + linux-libc-dev-mips-cross + +RUN apt install -qq -y \ + libc-dev:mips \ + libpopt-dev:mips \ + linux-libc-dev:mips + +{{ if eq .DEBIAN_VERSION "9" }} +# librpm-dev +RUN apt install -y \ + librpm-dev:mips \ + librpm3:mips \ + librpmio3:mips \ + librpmbuild3:mips \ + librpmsign3:mips \ + libxml2-dev:mips \ + libsqlite3-dev:mips \ + libnss3:mips \ + libsqlite3-0:mips \ + libxml2:mips \ + libsqlite3-0:mips + +# libsystemd-dev +# RUN apt install -y \ +# libsystemd-dev:mips libsystemd0:mips liblz4-1:mips +{{ end }} + +{{if eq .DEBIAN_VERSION "10"}} +# librpm-dev +RUN apt install -y \ + librpm-dev:mips + +# libsystemd-dev +RUN apt install -y \ + libsystemd-dev:mips +{{ end }} + +RUN rm -rf /var/lib/apt/lists/* + +COPY rootfs / + +# Basic test +RUN cd / \ + && mips-linux-gnu-gcc helloWorld.c -o helloWorld \ + && file helloWorld \ + && readelf -h helloWorld \ + && readelf -h helloWorld | grep -c 'MIPS R3000' \ + && readelf -h helloWorld | grep -c 'ELF32' \ + && readelf -h helloWorld | grep -c "big endian" \ + && rm helloWorld + + # Basic test + RUN cd / \ + && mipsel-linux-gnu-gcc helloWorld.c -o helloWorld \ + && file helloWorld \ + && readelf -h helloWorld \ + && readelf -h helloWorld | grep -c 'MIPS R3000' \ + && readelf -h helloWorld | grep -c 'ELF32' \ + && readelf -h helloWorld | grep -c "little endian" \ + && rm helloWorld.c helloWorld + +# Build-time metadata as defined at http://label-schema.org. +ARG BUILD_DATE +ARG IMAGE +ARG VCS_REF +ARG VCS_URL +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$IMAGE \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url=$VCS_URL \ + org.label-schema.schema-version="1.0" diff --git a/go1.16/mips32/Makefile b/go1.16/mips32/Makefile new file mode 100644 index 00000000..0a42375f --- /dev/null +++ b/go1.16/mips32/Makefile @@ -0,0 +1 @@ +include ../Makefile.common diff --git a/go1.16/mips32/rootfs/compilers.yaml b/go1.16/mips32/rootfs/compilers.yaml new file mode 100644 index 00000000..0fe35fd8 --- /dev/null +++ b/go1.16/mips32/rootfs/compilers.yaml @@ -0,0 +1,9 @@ +--- + +linux: + mips: + CC: mips-linux-gnu-gcc + CXX: mips-linux-gnu-g++ + mipsle: + CC: mipsel-linux-gnu-gcc + CXX: mipsel-linux-gnu-g++ diff --git a/go1.16/mips32/rootfs/helloWorld.c b/go1.16/mips32/rootfs/helloWorld.c new file mode 100644 index 00000000..dcfb86bc --- /dev/null +++ b/go1.16/mips32/rootfs/helloWorld.c @@ -0,0 +1,5 @@ +#include +int main() { + printf("Hello, World!"); + return 0; +} diff --git a/go1.16/ppc/Dockerfile.tmpl b/go1.16/ppc/Dockerfile.tmpl index 5fe2f40c..8551226b 100644 --- a/go1.16/ppc/Dockerfile.tmpl +++ b/go1.16/ppc/Dockerfile.tmpl @@ -3,33 +3,48 @@ ARG VERSION ARG TAG_EXTENSION='' FROM ${REPOSITORY}/golang-crossbuild:${VERSION}-base${TAG_EXTENSION} -RUN \ - dpkg --add-architecture ppc64el \ - && apt-get -o Acquire::Check-Valid-Until=false update -qq \ - && apt-get install -qq -y \ - --no-install-recommends \ - --allow-unauthenticated \ - g++-6-powerpc64-linux-gnu \ - gcc-6-powerpc64-linux-gnu \ - crossbuild-essential-ppc64el \ - librpm-dev:ppc64el \ +RUN dpkg --add-architecture ppc64el \ + && apt update -y --no-install-recommends \ + && apt upgrade -y --no-install-recommends \ + && apt full-upgrade -y --no-install-recommends \ + && apt install -qq -y --no-install-recommends \ + g++-powerpc64-linux-gnu \ + gcc-powerpc64-linux-gnu \ + crossbuild-essential-ppc64el + +RUN apt install -qq -y \ libc-dev:ppc64el \ libpopt-dev:ppc64el \ - linux-libc-dev:ppc64el \ + linux-libc-dev:ppc64el + +{{ if eq .DEBIAN_VERSION "9" }} +RUN apt install -qq -y \ + librpm-dev:ppc64el \ libxml2-dev:ppc64el \ libxml2:ppc64el \ - libicu-dev:ppc64el \ - libicu57:ppc64el \ - icu-devtools:ppc64el \ - libsystemd-dev:ppc64el \ librpm3:ppc64el \ librpmio3:ppc64el \ librpmbuild3:ppc64el \ librpmsign3:ppc64el \ libsqlite3-dev:ppc64el \ libnss3:ppc64el \ - libsqlite3-0:ppc64el \ - && rm -rf /var/lib/apt/lists/* + libsqlite3-0:ppc64el + +# RUN apt install -y \ +# libsystemd-dev:ppc64el libsystemd0:ppc64el liblz4-1:ppc64el +{{ end }} + +{{if eq .DEBIAN_VERSION "10"}} +# librpm-dev +RUN apt install -y \ + librpm-dev:ppc64el + +# libsystemd-dev +RUN apt install -y \ + libsystemd-dev:ppc64el +{{ end }} + +RUN rm -rf /var/lib/apt/lists/* COPY rootfs / diff --git a/go1.16/s390x/Dockerfile.tmpl b/go1.16/s390x/Dockerfile.tmpl index 0a89b18c..8ad9f0cc 100644 --- a/go1.16/s390x/Dockerfile.tmpl +++ b/go1.16/s390x/Dockerfile.tmpl @@ -3,32 +3,47 @@ ARG VERSION ARG TAG_EXTENSION='' FROM ${REPOSITORY}/golang-crossbuild:${VERSION}-base${TAG_EXTENSION} -RUN \ - dpkg --add-architecture s390x \ - && apt-get -o Acquire::Check-Valid-Until=false update -qq \ - && apt-get install -y -qq \ - --no-install-recommends \ - --allow-unauthenticated \ +RUN dpkg --add-architecture s390x \ + && apt update -y --no-install-recommends \ + && apt upgrade -y --no-install-recommends \ + && apt full-upgrade -y --no-install-recommends \ + && apt install -qq -y --no-install-recommends \ g++-s390x-linux-gnu \ - gcc-s390x-linux-gnu \ - librpm-dev:s390x \ + gcc-s390x-linux-gnu + +RUN apt install -qq -y \ libc-dev:s390x \ libpopt-dev:s390x \ - linux-libc-dev:s390x \ + linux-libc-dev:s390x + +{{ if eq .DEBIAN_VERSION "9" }} +RUN apt install -qq -y \ + librpm-dev:s390x \ libxml2-dev:s390x \ libxml2:s390x \ - libicu-dev:s390x \ - libicu57:s390x \ - icu-devtools:s390x \ - libsystemd-dev:s390x \ librpm3:s390x \ librpmio3:s390x \ librpmbuild3:s390x \ librpmsign3:s390x \ libsqlite3-dev:s390x \ libnss3:s390x \ - libsqlite3-0:s390x \ - && rm -rf /var/lib/apt/lists/* + libsqlite3-0:s390x + +# RUN apt install -y \ +# libsystemd-dev:s390x libsystemd0:s390x liblz4-1:s390x +{{ end }} + +{{if eq .DEBIAN_VERSION "10"}} +# librpm-dev +RUN apt install -y \ + librpm-dev:s390x + +# libsystemd-dev +RUN apt install -y \ + libsystemd-dev:s390x +{{ end }} + +RUN rm -rf /var/lib/apt/lists/* COPY rootfs /