Compare commits

...

86 Commits

Author SHA1 Message Date
Bensuperpc 6229ed696d revert 2026-07-19 16:34:31 +02:00
Bensuperpc a553432acd Test decentralized 2026-07-19 01:01:28 +02:00
Bensuperpc 79e54f909a Merge pull request #941 from bensuperpc/bensuperpc/fix-ci
Fix import/export docker image
2026-07-12 06:13:54 +02:00
Bensuperpc 87ef3f1134 Fix import/export docker image 2026-07-04 08:53:30 +02:00
Matt McCormick 3b5d46f70b Merge pull request #929 from dockcross/dependabot/github_actions/actions/download-artifact-8
build(deps): bump actions/download-artifact from 7 to 8
2026-07-02 14:06:07 -04:00
Matt McCormick 5fd14ac6dc Merge pull request #937 from arrowd/loongarch64
Introduce linux-loongarch64
2026-05-15 16:25:38 -04:00
Jonas Vautherin dcde0d124c ci: add C_arg: -DCMAKE_C_FLAGS=-Wno-incompatible-pointer-types to loongarch64 2026-05-11 21:57:22 +02:00
Gleb Popov 175e4d66e2 Introduce linux-loongarch64 2026-05-11 22:25:12 +03:00
Matt McCormick 4aaaa2c847 Merge pull request #934 from julianoes/manylinux_2_34-aarch64
Add manylinux_2_34_aarch64 (rebased and fixed up)
2026-04-14 09:33:20 -04:00
Julian Oes 6a3933b03b Add manylinux_2_34 includes to DOCKER_COMPOSITE_SOURCES
The common.manylinux_2_34 and common-manylinux_2_34.crosstool includes
were missing from the Makefile, so the sed preprocessor never expanded
them when generating Dockerfiles from .in files. This caused XCC_PREFIX
to be undefined in the aarch64 Dockerfile.
2026-04-10 09:32:09 +12:00
Julian Oes 7264bf7768 Build git without gettext to avoid missing msgfmt
The pypa manylinux_2_34 base image does not provide the msgfmt binary,
causing the git source build to fail. Git translations are not needed
in a build container.
2026-04-10 09:32:01 +12:00
Julian Oes ad3c0cad8c manylinux_2_34: fix libstdc++ ABI mismatch by isolating host headers
Using -I/usr/include during the crosstool-ng build of libstdc++ pulled
in host x86_64 headers where int64_t is long long, contaminating the
aarch64 cross-build where int64_t should be long. This caused linker
errors for std::__atomic_futex_unsigned_base symbols due to mismatched
C++ name mangling between headers and the built library.

Copy only the required sys/sdt.h headers into /opt/ct-ng-includes and
point CT_CC_GCC_ENABLE_CXX_FLAGS there instead, matching the approach
used by manylinux_2_28-aarch64.
2026-04-09 03:22:00 +12:00
Julian Oes 84419c14a5 manylinux_2_34: add another perl dependency for OpenSSL build 2026-04-09 03:21:59 +12:00
Julian Oes 8c8f0f6fa6 manylinux_2_34: add missing tools for OpenSSL test build 2026-04-09 03:21:58 +12:00
Julian Oes 4fb4c4e401 Remove copy_libstd.sh workaround from manylinux_2_34-aarch64
The libstdc++ copy trick is no longer needed, as noted in PR #931
which removed it for manylinux2014-aarch64.
2026-04-09 03:21:57 +12:00
Julian Oes 9c32f366f9 Fix CMAKE_CROSSCOMPILING_EMULATOR path to use qemu-aarch64-static
AlmaLinux 9 doesn't package qemu-user-static, so the Dockerfile
downloads the static binary as /usr/bin/qemu-aarch64-static.
The Toolchain.cmake was incorrectly referencing /usr/bin/qemu-aarch64.
2026-04-09 03:21:56 +12:00
Julian Oes 2b735bef0e Fix typos in Dockerfile.in and prepare_cross_env.sh 2026-04-09 03:21:55 +12:00
Julian Oes 324d42a107 Fix typo: rename docker_setup_scrpits to docker_setup_scripts 2026-04-09 03:21:54 +12:00
Julian Oes 3348cdba6d Revert CMAKE_FIND_ROOT_PATH_MODE_* to match other variants
Remove CACHE STRING "" from CMAKE_FIND_ROOT_PATH_MODE_PROGRAM,
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY, and CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
to be consistent with all other cross-compilation toolchain files.
2026-04-09 03:21:53 +12:00
Joris Gillis c847b1910e allow overriding of CMAKE_FIND_ROOT_PATH_MODE_* 2026-04-09 03:21:51 +12:00
Joris Gillis 49aa64b08f Add manylinux_2_34-aarch64 to CI configuration 2026-04-09 03:21:47 +12:00
Joris Gillis b59e741d8f Add manylinux_2_34-aarch64 documentation to README 2026-04-09 03:21:44 +12:00
Joris Gillis 65320e84c6 Add manylinux_2_34-aarch64 cross-compilation image
New Docker image for building manylinux_2_34 compatible wheels targeting
64-bit ARM (aarch64) architecture.

- Based on AlmaLinux 9 with crosstool-ng 1.27.0 toolchain
- Uses multiarch/qemu-user-static for cross-compilation emulation
- Includes wheel repair script for manylinux compliance
- GCC configured with --disable-gcov (Bug 100289 workaround)
2026-04-09 03:21:40 +12:00
Matt McCormick 3853c9f0da Merge pull request #935 from julianoes/manylinux_2_28-aarch64
Add manylinux_2_28_aarch64
2026-04-08 10:12:33 -04:00
Julian Oes fc73010e35 Readme: Add manylinux_2_28-aarch64 2026-04-07 09:50:52 +12:00
Julian Oes 7679060f71 manylinux_2_28: add perl dependency for OpenSSL build 2026-04-04 11:32:15 +13:00
Julian Oes c3389c3671 CI: add manylinux_2_28 build 2026-04-04 11:32:02 +13:00
Julian Oes f15327adbd Add perl-IPC-Cmd package for OpenSSL build support
AlmaLinux 8 splits perl-IPC-Cmd into a separate package, which is
needed by OpenSSL's Configure script.
2026-04-03 14:32:20 +13:00
Julian Oes 003dfa0517 Remove copy_libstd.sh workaround from manylinux_2_28-aarch64
The libstdc++ copy trick is no longer needed, as noted in PR #931
which removed it for manylinux2014-aarch64.
2026-04-03 14:28:11 +13:00
Julian Oes 7633bc2b5e Add manylinux_2_28-aarch64 image and fix qemu path in 2_34 variant
Add a new manylinux_2_28-aarch64 cross-compilation image targeting
AlmaLinux 8 (glibc 2.28) for building portable Python wheels for
aarch64 from x86_64 hosts. Based on the manylinux_2_34-aarch64
variant with adjusted glibc (2.28) and kernel headers (4.18).

Also fix CMAKE_CROSSCOMPILING_EMULATOR in the 2_34 Toolchain.cmake
to use /usr/bin/qemu-aarch64-static (matching what the Dockerfile
actually installs).
2026-04-03 14:28:10 +13:00
Matt McCormick 9b3357cf9b Merge pull request #933 from dockcross/dependabot/github_actions/docker/login-action-4
build(deps): bump docker/login-action from 3 to 4
2026-03-12 17:21:48 -04:00
dependabot[bot] 326655d148 build(deps): bump docker/login-action from 3 to 4
Bumps [docker/login-action](https://github.com/docker/login-action) from 3 to 4.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-04 18:22:30 +00:00
Jonas Vautherin b2fe0003a7 Merge pull request #931 from dockcross/jonas/fix-manylinux2014-aarch64
manylinux2014-aarch64: fix libstdc++
2026-03-04 13:50:10 +01:00
Jonas Vautherin da91964615 manylinux2014-aarch64: fix libstdc++ 2026-03-04 00:09:00 +01:00
Matt McCormick 8e64601fd2 Merge pull request #930 from dockcross/dependabot/github_actions/actions/upload-artifact-7
build(deps): bump actions/upload-artifact from 6 to 7
2026-03-02 13:28:58 -05:00
Matt McCormick 551d8b719c Merge pull request #928 from MUWASEC/patch-1
fix bash warning message in dockcross.sh
2026-02-27 15:39:12 -05:00
dependabot[bot] dc32c32646 build(deps): bump actions/upload-artifact from 6 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-27 18:22:30 +00:00
dependabot[bot] 06384754b0 build(deps): bump actions/download-artifact from 7 to 8
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-27 18:22:18 +00:00
muwa00 471f25e046 fix bash warning message in dockcross.sh 2026-02-25 22:19:46 +07:00
Matt McCormick af62f2c926 Merge pull request #925 from thewtex/wasm-bump
web-wasm: bump emscripten to 5.0.0
2026-02-21 07:45:14 -05:00
Matt McCormick f41690cc1e web-wasm: bump emscripten to 5.0.1
Disable raylib, which seems to have an unrelated error.
2026-02-20 16:57:16 -05:00
Matt McCormick 84793ba73e Merge pull request #927 from dockcross/openssl-patch-path
ci: update MAVSDK openssl patch
2026-02-20 16:54:06 -05:00
Matt McCormick 8385fa701f ci: update MAVSDK openssl patch
And use commit for reproducible fetch
2026-02-19 11:09:21 -05:00
Matt McCormick 3dfb3ff1a9 Merge pull request #919 from dockcross/dependabot/github_actions/actions/checkout-6
build(deps): bump actions/checkout from 5 to 6
2026-02-03 05:39:22 -05:00
dependabot[bot] eff583f55e build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-03 02:34:37 +00:00
Jonas Vautherin 90e40d4cbf Merge pull request #923 from dockcross/upload-download-artifact
ci: update upload and download artifact action versions to latest
2026-02-02 10:34:42 +01:00
Matt McCormick 937d4df040 ci: update upload and download artifact action versions to latest 2026-02-01 21:47:01 -05:00
Matt McCormick b37f297308 Merge pull request #922 from dmlary/manylinux-builder-group
manylinux: add builder group to own python files
2026-01-29 13:57:47 -05:00
David M. Lary c3e5f808a6 manylinux: Fixes for gid check, and chown python /man directories 2026-01-26 15:06:24 -06:00
David M. Lary f3fc294a08 manylinux: add builder group to own python files
The manylinux images can take over a minute to start on spinning disks
(not SSDs) because pre_exec.sh is changing the ownership of all the
python install directories to be writable by the BUILDER_UID.  This is
detailed further in #853.

I changed the build steps for manylinux images to add a group called
`builder`, then change the python directories to be owned by the
`builder` group, and group writable.  I then changed pre_exec.sh to add
BUILDER_USER to the builder group prior to the gosu switch to become
BUILDER_USER.  The result is that BUILDER_USER is in the `builder`
group that can write to the python directories, allowing the user to
install python packages without permission denied errors.

There was one additional change to support this, and that was the
arguments to `gosu` in entrypoint.sh.  Previously the arguments were
`$BUILDER_UID:BUILDER_GID`, but providing the gid prevents `gosu` from
loading additional groups (such as `builder`) from /etc/group.  I
removed the GID argument to allow `gosu` to pick up additional groups
from /etc/group.

fixes #853
2026-01-21 15:58:45 -06:00
Matt McCormick 1d3b81221c Merge pull request #904 from deckstose/push-pytvwvzxrmql
fix: use more portable `type -P` to find executable
2026-01-05 14:17:18 -05:00
Matt McCormick 8b9ace46ce Merge pull request #913 from thewtex/change-rustup-install
common: install rustup into /opt/rustup
2025-10-10 21:58:52 -04:00
Matt McCormick 63e91f59aa common: install rustup into /opt/rustup
To avoid long-running chown's per https://github.com/dockcross/dockcross/issues/901
2025-10-09 08:17:27 -04:00
Matt McCormick 98e6c48697 Merge pull request #912 from thewtex/wasi-bump
wasi: bump wasi-sdk to version 27
2025-09-29 22:26:24 -04:00
Matt McCormick 9de64a24c2 wasi: bump wasi-sdk to version 27
Includes LLVM bump to version 21.
2025-09-26 10:59:35 -04:00
Matt McCormick 66fda89f8d Merge pull request #911 from thewtex/buildah-manifest-tool
ci: push multi-arch images with manifest-tool
2025-09-25 22:08:26 -04:00
Matt McCormick 13872ace65 ci: push multi-arch images with manifest-tool
Instead of buildah.

- Simplified workflow: manifest-tool provides a more straightforward command-line interface for creating manifest lists
- Better integration: manifest-tool is specifically designed for manifest list/OCI index creation and management
- Cross-platform compatibility: Works with both Docker v2.2 manifest lists and OCI v1 indexes
- Template-based approach: The --template and --platforms flags provide a cleaner way to specify multi-arch images
2025-09-24 11:24:33 -04:00
Matt McCormick 6ea98ba7f7 Merge pull request #909 from thewtex/manylinux-2-28-gcc-version
manylinux_2_28: GCC toolset version 14 sudo removal
2025-09-13 15:43:56 -04:00
Matt McCormick 015205b0c9 manylinux_2_28: GCC toolset version 14 sudo removal 2025-09-12 16:51:26 -04:00
Matt McCormick 87b9db46eb Merge pull request #908 from thewtex/emscripten-4.0.14
web-wasm: bump emscripten to 4.0.14
2025-09-11 10:06:47 -04:00
Matt McCormick 2eaff8a971 Merge pull request #907 from thewtex/manylinux-2-28-x64-bump
manylinux_2_28_x64: bump base to 2025.08.12-1
2025-09-11 08:27:58 -04:00
Matt McCormick c59cf19b0b web-wasm: bump emscripten to 4.0.14 2025-09-10 15:28:59 -04:00
Matt McCormick d59579d028 manylinux_2_28_x64: bump base to 2025.08.12-1
Relatively recent image that passed container security checks.
2025-09-10 15:16:29 -04:00
Matt McCormick b1ae758f3d Merge pull request #906 from dockcross/dependabot/github_actions/actions/stale-10
build(deps): bump actions/stale from 9 to 10
2025-09-10 14:41:12 -04:00
Matt McCormick c5d3885212 Merge pull request #905 from jcfr/update-imagefiles-utils-script
chore(imagesfiles): Refactor script introducing fetch_source function
2025-09-10 14:39:43 -04:00
dependabot[bot] 9b52d93255 build(deps): bump actions/stale from 9 to 10
Bumps [actions/stale](https://github.com/actions/stale) from 9 to 10.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v9...v10)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 18:02:02 +00:00
Jean-Christophe Fillion-Robin e52623c8dc fix(install-cmake-binary): Revert back to installing upstream CMake package
Since the Centos 5 image is not maintained anymore, there is no need to install
the custom CMake package originally intended to support GLIBC version from Centos 5.
2025-08-27 12:34:45 -04:00
Jean-Christophe Fillion-Robin 9f4e0b7413 chore(imagesfiles): Refactor script introducing fetch_source function
Update options preferring their more explicit long form:
`-f` is `--fail`
`-s` is `--silent`
`-S` is `--show-error`
`-L` is `--location`

Additionally, `-O` is removed in favor of explicitly specifying the output file using `-o`
2025-08-27 11:57:08 -04:00
Steffen Winter 4a8ba629f6 fix: use more portable type -p to find executable
`which` is not guaranteed to be installed on all machines. Since the
script is meant to be run on the user's host machine it is more portable
to use `type -p` here.

Closes: https://github.com/dockcross/dockcross/issues/880
2025-08-25 22:36:16 +02:00
Jonas Vautherin 0a27819132 Merge pull request #903 from dockcross/update-android-to-sdk-24
Update Android SDK to 24
2025-08-18 08:02:40 +02:00
Jonas Vautherin c756bd6080 Update Android SDK to 24 2025-08-16 13:32:11 +02:00
Matt McCormick 7075966713 Merge pull request #902 from dockcross/dependabot/github_actions/actions/checkout-5
build(deps): bump actions/checkout from 4 to 5
2025-08-13 13:51:27 -04:00
dependabot[bot] 70ac69b358 build(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 20:28:23 +00:00
Bensuperpc 0415f7888d Merge pull request #899 from bensuperpc/update-ci
Add SQLite test build and update Makefile
2025-08-08 18:11:17 +02:00
Jonas Vautherin 886c97e98f Merge pull request #900 from dockcross/dependabot/github_actions/actions/download-artifact-5
build(deps): bump actions/download-artifact from 4 to 5
2025-08-07 19:08:02 +02:00
dependabot[bot] 6532c5bdee build(deps): bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-06 18:42:20 +00:00
Bensuperpc 0e30f0a04e Add SQLite test build and update Makefile
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2025-08-05 09:08:38 +02:00
Jonas Vautherin 86f66d2270 Merge pull request #895 from Enaium/master
Update ndk to r28b
2025-07-31 23:57:06 +02:00
Jonas Vautherin a9155a09f6 Disable unmaintained C-Plus-Plus build test 2025-07-31 07:01:11 +02:00
Jean-Christophe Fillion-Robin 14a29475ca Merge pull request #897 from jcfr/update-install-gosu-binary-to-prefer-checking-against-secured-key-server
fix(install-gosu-binary): Prefer checking key from server using "hkps" protocol
2025-07-22 13:24:49 -04:00
Jean-Christophe Fillion-Robin f48bb9b136 fix(entrypoint.sh): Avoid error if rustup is not installed
Only move `/root/.rustup` and `/root/.cargo` directories if they exist.
This prevents errors when re-using the script in environments where
Rust is not installed (e.g. https://github.com/dockbuild/dockbuild).

Previously, `mv` would fail if either directory was missing:

```
mv: cannot stat '/root/.rustup': No such file or directory
mv: cannot stat '/root/.cargo': No such file or directory
```
2025-07-22 13:23:18 -04:00
Jean-Christophe Fillion-Robin fe6baacdd3 fix(install-gosu-binary): Prefer checking key from server using "hkps" protocol 2025-07-21 18:26:10 -04:00
Jonas Vautherin 11090d1ded Update Stockfish to 17.1 2025-07-15 12:24:53 +02:00
Enaium 731b331faf Update ndk to r28b 2025-07-07 11:07:43 +08:00
Matt McCormick 70cca217e4 Merge pull request #894 from drinkcat/dev-pts-0-silence
entrypoint.sh: Silence errors if /dev/pts/0 does not exist
2025-07-02 16:27:25 -04:00
Nicolas Boichat 52604c0b66 entrypoint.sh: Silence errors if /dev/pts/0 does not exist 2025-07-02 11:41:08 +08:00
136 changed files with 5775 additions and 2075 deletions
+10 -10
View File
@@ -1,22 +1,22 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '0 */8 * * *'
- cron: '0 */12 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
- uses: actions/stale@v10
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
exempt-issue-milestones: 'future,alpha,beta,release,bugfix,improvement,enhancement,help wanted'
exempt-pr-milestones: 'bugfix,improvement,enhancement,help wanted'
exempt-all-pr-assignees: true
stale-issue-message: 'This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
stale-pr-message: 'This PR is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity.'
days-before-issue-stale: 120
days-before-pr-stale: 120
days-before-issue-close: 30
days-before-pr-close: 30
stale-issue-message: 'This issue is stale because it has been open 240 days with no activity. Remove stale label or comment or this will be closed in 90 days.'
stale-pr-message: 'This PR is stale because it has been open 240 days with no activity. Remove stale label or comment or this will be closed in 90 days.'
close-issue-message: 'This issue was closed because it has been stale for 90 days with no activity.'
close-pr-message: 'This PR was closed because it has been stale for 90 days with no activity.'
days-before-issue-stale: 240
days-before-pr-stale: 240
days-before-issue-close: 90
days-before-pr-close: 90
+126 -1392
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
+1
View File
@@ -1,4 +1,5 @@
bin
.dockcross-test-cache
dockcross
dockcross-*
build
+3
View File
@@ -0,0 +1,3 @@
{
"python-envs.defaultEnvManager": "ms-python.python:system"
}
+72 -46
View File
@@ -198,39 +198,51 @@ Once this part is finished, there must be 3 files in the `linux-arm64` folder:
### Makefile
For this last part, we will see how to add the image to the [Makefile](Makefile) and to a github action.
The [Makefile](Makefile) is generic: it knows how to generate/build/test/push
an image out of a "preset" directory, but it has no built-in knowledge of the
actual list of dockcross images. Every image folder is a preset that is
auto-discovered because it contains a `preset.mk` file - there is no central
list to edit anymore.
You need to add the image/folder name (**linux-arm64**) to the **STANDARD_IMAGES** variable in the [Makefile](Makefile):
To add the image to the build system, create **`linux-arm64/preset.mk`**:
```make
# These images are built using the "build implicit rule"
STANDARD_IMAGES = android-arm android-arm64 android-x86 android-x86_64 \
linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-m68k-uclibc linux-s390x linux-x64-tinycc \
linux-armv6 linux-armv6-lts linux-armv6-musl linux-arm64-lts \
linux-armv7l-musl linux-armv7 linux-armv7a linux-armv7-lts linux-x86_64-full \
linux-mips linux-ppc64le linux-riscv64 linux-riscv32 linux-xtensa-uclibc \
web-wasi \
windows-static-x86 windows-static-x64 windows-static-x64-posix windows-armv7 \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix windows-arm64
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-arm64
```
You need to add the image/folder name (`linux-arm64`) to the `GEN_IMAGES` variable in the [Makefile](Makefile):
`BASE_IMAGE_NAME = base` / `BASE_IMAGE_TAG = latest` matches the common case
where `Dockerfile.in` starts with `ARG ORG=dockcross` / `FROM ${ORG}/base:latest`
(the image is built on top of the local `base` preset). `OUTPUT_IMAGE_NAME`
should match the folder name so the built image is tagged
`<registry>/<path>/linux-arm64`.
```make
# Generated Dockerfiles.
GEN_IMAGES = android-arm android-arm64 \
linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
manylinux2014-x64 manylinux2014-x86 \
manylinux2014-aarch64 linux-arm64-lts \
web-wasm web-wasi linux-mips windows-arm64 windows-armv7 \
windows-static-x86 windows-static-x64 windows-static-x64-posix \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix \
linux-armv7 linux-armv7a linux-armv7l-musl linux-armv7-lts linux-x86_64-full \
linux-armv6 linux-armv6-lts linux-armv6-musl \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-ppc64le linux-s390x \
linux-riscv64 linux-riscv32 linux-m68k-uclibc linux-x64-tinycc linux-xtensa-uclibc
```
A `preset.mk` can override or add anything the generic Makefile doesn't
already do the right thing for, for example:
- `TEST_IMAGE_CMD` / `TEST_IMAGE_ARGS`: override the command run by `make
<image>.test` (defaults to `python3 test/run.py`). E.g. an image that only
supports C needs `TEST_IMAGE_ARGS = --languages C`.
- `BUILD_CONTEXT_DIR`: override the docker build context directory. Defaults
to the preset's own folder; a few images (the manylinux\*-aarch64/x64/x86
family) `COPY` files from sibling folders and need
`BUILD_CONTEXT_DIR = $(PRESET_DIR)` (the repository root) instead.
- `DEPENDS_ON`: list of `<preset>.build` targets that must be built first,
for images whose `Dockerfile.in` is `FROM ${ORG}/<other-image>:latest`
(e.g. `manylinux2014-aarch64` depends on `manylinux2014-x64`).
- `EXTRA_BUILD_ARGS`: extra `--build-arg KEY=VALUE` flags.
- `STATIC_DOCKERFILE = yes`: for the rare image that ships a committed
`Dockerfile` instead of a generated `Dockerfile.in`.
See [linux-arm64/preset.mk](linux-arm64/preset.mk) and, for the more
involved cases, [manylinux2014-aarch64/preset.mk](manylinux2014-aarch64/preset.mk)
or [web-wasm/preset.mk](web-wasm/preset.mk).
### Image building and testing
@@ -268,27 +280,41 @@ With CMake + Ninja:
### CI (github action)
To finish, you have to add to `.github/workflows/main.yml` the image/folder name:
To finish, you have to add the image/folder name to the `images` job's matrix
in `.github/workflows/main.yml`:
```yml
# Linux arm64/armv8 images
- {
image: "linux-arm64",
stockfish: "yes",
stockfish_arg: "ARCH=armv8",
ninja: "yes",
ninja_arg: "",
openssl: "yes",
openssl_arg: "linux-aarch64",
C: "yes",
C_arg: "",
C-Plus-Plus: "yes",
C-Plus-Plus_arg: "",
fmt: "yes",
fmt_arg: "",
cpython: "yes",
cpython_arg: "--host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu",
}
- { image: "linux-arm64", multiarch: "yes" }
```
You can disable and enable the build of certain tests which can cause problems with certain CPU architectures (eg. OpenSSL with Risc-V...).
`multiarch: "yes"` is only for the handful of images that are natively built
and published for both amd64 and arm64 (see `deploy-multi-arch-images` in the
same file); everything else should leave it empty.
That's the only thing the CI workflow needs to know. It builds the image with
`make <image>`, runs the fast in-container smoke test with `make
<image>.test`, and then `make <image>.test-extra` - which builds a handful of
real upstream projects (Stockfish, CMake, OpenSSL, CPython, ...) with the
image's toolchain. Which of those extra tests apply to this image and their
architecture-specific flags are **not** set in the workflow: they belong in
the image's own `preset.mk`, e.g.:
```make
EXTRA_TESTS = stockfish ninja openssl SQLite fmt cpython
STOCKFISH_ARGS = ARCH=armv8
OPENSSL_ARGS = linux-aarch64
CPYTHON_ARGS = --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu
```
What each extra test actually clones and builds is defined once in the
[Makefile](Makefile) ("Extra tests" section) so it stays identical across
every image. You can run any of them locally, the same way CI does:
```bash
make linux-arm64.test-extra # everything EXTRA_TESTS lists
make linux-arm64.test-stockfish # one test directly, regardless of EXTRA_TESTS
```
Leave `EXTRA_TESTS` unset for images where a given upstream project doesn't
build (e.g. OpenSSL on some RISC-V targets).
+2 -2
View File
@@ -1,5 +1,5 @@
ARG DOCKER_IMAGE=debian:bookworm-slim
FROM $DOCKER_IMAGE
ARG BASE_IMAGE=debian:bookworm-slim
FROM $BASE_IMAGE
LABEL maintainer="Matt McCormick matt@mmmccormick.com"
+376 -379
View File
@@ -1,423 +1,420 @@
# ==============================================================================
# Preset detection
# ==============================================================================
PRESET_DIR ?= .
#
# Parameters
#
HOST_ARCH := $(or $(HOST_ARCH), $(shell uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/'))
# Name of the docker-equivalent executable for building images.
# OCI: open container interface.
# Common values: docker, podman, buildah
DOCKER := $(or $(OCI_EXE), docker)
BUILD_DOCKER := $(or $(BUILD_DOCKER), $(DOCKER))
BUILDAH := $(or $(BUILDAH_EXE), buildah)
# Name of the docker-equivalent executable for running test containers.
# Supports the use case:
#
# DOCKER=buildah
# TEST_DOCKER=podman
#
# because buildah does not run containers.
TEST_DOCKER := $(or $(TEST_DOCKER), $(DOCKER))
preset-path = $(if $(filter base,$(1)),$(PRESET_DIR),$(PRESET_DIR)/$(1))
# The build sub-command. Use:
#
# export "BUILD_CMD=buildx build --platform linux/amd64,linux/arm64"
#
# to generate multi-platform images.
BUILD_CMD := $(or $(BUILD_CMD), build)
TAG_FLAG := $(or $(TAG_FLAG), --tag)
build-context-dir = $(if $(BUILD_CONTEXT_DIR),$(BUILD_CONTEXT_DIR),$(call preset-path,$(1)))
# Docker organization to pull the images from
ORG = dockcross
PRESET_FILES := $(shell find $(PRESET_DIR) -name .git -prune -o -mindepth 2 -name "preset.mk" -print)
ALL_PRESETS := base $(patsubst $(PRESET_DIR)/%/preset.mk,%,$(PRESET_FILES))
# Host architecture
HOST_ARCH := $(or $(HOST_ARCH), $(shell uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/'))
CURRENT_TARGET_NAME := $(firstword $(MAKECMDGOALS))
# Directory where to generate the dockcross script for each images (e.g bin/dockcross-manylinux2014-x64)
BIN = ./bin
POSSIBLE_PRESET := $(basename $(CURRENT_TARGET_NAME))
# These images are built using the "build implicit rule"
STANDARD_IMAGES := android-arm android-arm64 android-x86 android-x86_64 \
linux-i686 linux-x86 linux-x64 linux-x64-clang linux-arm64-musl linux-arm64-full \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-m68k-uclibc linux-s390x linux-x64-tinycc \
linux-armv6 linux-armv6-lts linux-armv6-musl linux-arm64-lts linux-mipsel-lts \
linux-armv7l-musl linux-armv7 linux-armv7a linux-armv7-lts linux-armv7a-lts linux-x86_64-full \
linux-mips linux-mips-uclibc linux-mips-lts linux-ppc linux-ppc64le linux-ppc64le-lts linux-riscv64 linux-riscv32 linux-xtensa-uclibc \
windows-static-x86 windows-static-x64 windows-static-x64-posix windows-armv7 \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix windows-arm64 \
bare-armv7emhf-nano_newlib
# Generated Dockerfiles.
GEN_IMAGES := android-arm android-arm64 \
linux-i686 linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
manylinux_2_28-x64 manylinux_2_34-x64 \
manylinux2014-x64 manylinux2014-x86 \
manylinux2014-aarch64 linux-arm64-lts \
web-wasm web-wasi web-wasi-emulated-threads web-wasi-threads linux-mips linux-mips-uclibc linux-mips-lts windows-arm64 windows-armv7 \
windows-static-x86 windows-static-x64 windows-static-x64-posix \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix \
linux-armv7 linux-armv7a linux-armv7l-musl linux-armv7-lts linux-armv7a-lts linux-x86_64-full \
linux-armv6 linux-armv6-lts linux-armv6-musl linux-mipsel-lts \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-ppc linux-ppc64le linux-ppc64le-lts linux-s390x \
linux-riscv64 linux-riscv32 linux-m68k-uclibc linux-x64-tinycc linux-xtensa-uclibc \
bare-armv7emhf-nano_newlib
# Generate both amd64 and arm64 images
MULTIARCH_IMAGES := linux-arm64 \
web-wasi web-wasi-emulated-threads
GEN_IMAGE_DOCKERFILES = $(addsuffix /Dockerfile,$(GEN_IMAGES))
# These images are expected to have explicit rules for *both* build and testing
NON_STANDARD_IMAGES := manylinux_2_28-x64 manylinux_2_34-x64 manylinux2014-x64 manylinux2014-x86 \
manylinux2014-aarch64 web-wasm web-wasi-emulated-threads web-wasi-threads
# Docker composite files
DOCKER_COMPOSITE_SOURCES = common.docker common.debian common.manylinux2014 common.manylinux_2_28 common.manylinux_2_34 common.buildroot \
common.crosstool common.webassembly common.windows common-manylinux.crosstool common.dockcross \
common.label-and-env
DOCKER_COMPOSITE_FOLDER_PATH = common/
DOCKER_COMPOSITE_PATH = $(addprefix $(DOCKER_COMPOSITE_FOLDER_PATH),$(DOCKER_COMPOSITE_SOURCES))
# This list all available images
IMAGES := $(STANDARD_IMAGES) $(NON_STANDARD_IMAGES) $(MULTIARCH_IMAGES)
# Optional arguments for test runner (test/run.py) associated with "testing implicit rule"
linux-x64-tinycc.test_ARGS = --languages C
windows-static-x86.test_ARGS = --exe-suffix ".exe"
windows-static-x64.test_ARGS = --exe-suffix ".exe"
windows-static-x64-posix.test_ARGS = --exe-suffix ".exe"
windows-shared-x86.test_ARGS = --exe-suffix ".exe"
windows-shared-x64.test_ARGS = --exe-suffix ".exe"
windows-shared-x64-posix.test_ARGS = --exe-suffix ".exe"
windows-armv7.test_ARGS = --exe-suffix ".exe"
windows-arm64.test_ARGS = --exe-suffix ".exe"
bare-armv7emhf-nano_newlib.test_ARGS = --linker-flags="--specs=nosys.specs"
# On CircleCI, do not attempt to delete container
# See https://circleci.com/docs/docker-btrfs-error/
RM = --rm
ifeq ("$(CIRCLECI)", "true")
RM =
ifeq ($(POSSIBLE_PRESET),base)
-include $(PRESET_DIR)/preset.mk
else ifneq ($(wildcard $(PRESET_DIR)/$(POSSIBLE_PRESET)/preset.mk),)
include $(PRESET_DIR)/$(POSSIBLE_PRESET)/preset.mk
endif
# Tag images with date and Git short hash in addition to revision
TAG := $(shell date '+%Y%m%d')-$(shell git rev-parse --short HEAD)
# ==============================================================================
# Main config Makefile for Docker SDK Images
# ==============================================================================
AUTHOR ?= dockcross
WEB_SITE ?= dockcross.org
# shellcheck executable
SHELLCHECK := shellcheck
# Registries
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?=
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
# Defines the level of verification (error, warning, info...)
SHELLCHECK_SEVERITY_LEVEL := error
# Docker Config
DOCKER_EXEC ?= docker
PROGRESS_OUTPUT ?= plain
#
# images: This target builds all IMAGES (because it is the first one, it is built by default)
#
images: base $(IMAGES)
#
# test: This target ensures all IMAGES are built and run the associated tests
#
test: base.test $(addsuffix .test,$(IMAGES))
#
# Generic Targets (can specialize later).
#
$(GEN_IMAGE_DOCKERFILES) Dockerfile: %Dockerfile: %Dockerfile.in $(DOCKER_COMPOSITE_PATH)
sed \
-e '/common.docker/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.docker' \
-e '/common.debian/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.debian' \
-e '/common.manylinux_2_28/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.manylinux_2_28' \
-e '/common.manylinux_2_34/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.manylinux_2_34' \
-e '/common.manylinux2014/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.manylinux2014' \
-e '/common.crosstool/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.crosstool' \
-e '/common.buildroot/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.buildroot' \
-e '/common-manylinux.crosstool/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common-manylinux.crosstool' \
-e '/common.webassembly/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.webassembly' \
-e '/common.windows/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.windows' \
-e '/common.dockcross/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.dockcross' \
-e '/common.label-and-env/ r $(DOCKER_COMPOSITE_FOLDER_PATH)common.label-and-env' \
$< > $@
#
# web-wasm
#
ifeq ($(HOST_ARCH),amd64)
EMSCRIPTEN_HOST_ARCH_TAG = ""
PUSH_ON_BUILD ?= false
ifeq ($(PUSH_ON_BUILD),true)
DOCKER_DRIVER := --push
BUILD_IMAGE_ARGS += --sbom=true --provenance=true
BUILD_IMAGE_ARGS += --cache-from=type=registry,ref=$(OUTPUT_IMAGE_FINAL):cache
BUILD_IMAGE_ARGS += --cache-to=type=registry,ref=$(OUTPUT_IMAGE_FINAL):cache,mode=max
else
DOCKER_DRIVER := --load
endif
ifeq ($(HOST_ARCH),arm64)
EMSCRIPTEN_HOST_ARCH_TAG = "-arm64"
ARCH_LIST ?= linux/$(HOST_ARCH)
PLATFORMS ?= $(subst $(space),$(comma),$(strip $(ARCH_LIST)))
TMPFS_SIZE ?= 4g
DOCKER_BUILD_NETWORK ?= host
# Folders
COMMON_DIR ?= common
BIN_DIR ?= ./bin
TEST_SCRATCH_DIR ?= ./.dockcross-test-cache
EXTRA_TESTS ?=
ORG ?= $(OUTPUT_IMAGE_REGISTRY)/$(OUTPUT_IMAGE_PATH)
DOCKER_COMPOSITE_SOURCES = common.docker common.debian \
common.manylinux2014 common.manylinux_2_28 common.manylinux_2_34 \
common.buildroot common.crosstool common.webassembly common.windows \
common-manylinux.crosstool common-manylinux_2_28.crosstool common-manylinux_2_34.crosstool \
common.dockcross common.label-and-env
# RUN/TEST
TEST_IMAGE_CMD ?= python3 test/run.py
TEST_IMAGE_ARGS ?=
RUN_IMAGE_CMD ?= /bin/bash
RUN_IMAGE_ARGS ?=
BUILD_CONTEXT_DIR ?=
STATIC_DOCKERFILE ?= no
DEPENDS_ON ?= base.build
EXTRA_BUILD_ARGS ?=
BIND_HOST_DIR := $(shell pwd)
BIND_CONTAINER_DIR ?= /work
WORKDIR ?= /work
# Automatic variables
CURRENT_USER := $(shell whoami)
UID := $(shell id -u ${CURRENT_USER})
GID := $(shell id -g ${CURRENT_USER})
CURRENT_GROUP := $(shell id -gn ${CURRENT_USER})
BUILDER_ENV := -e BUILDER_UID=$(UID) -e BUILDER_GID=$(GID) -e BUILDER_USER=$(CURRENT_USER) -e BUILDER_GROUP=$(CURRENT_GROUP)
DATE := $(shell date -u +"%Y%m%d")
GIT_SHA := $(shell git rev-parse --short HEAD 2>/dev/null || echo nogit)
GIT_ORIGIN := $(shell git config --get remote.origin.url 2>/dev/null || echo unknown)
UUID := $(shell uuidgen)
TRIVY_IMAGE ?= aquasec/trivy:0.68.2
HADOLINT_IMAGE ?= hadolint/hadolint:v2.14.0
SHELLCHECK_IMAGE ?= koalaman/shellcheck:stable
# Tag images with date and Git short hash, mirroring the historical dockcross tagging scheme
TAG := $(DATE)-$(GIT_SHA)
comma := ,
space := $(subst ,, )
# ==============================================================================
# Presets logic
# ==============================================================================
PRESET_TARGETS := all help build test push pull generate scan lint update clean run inspect sbom script \
rebuild sign history cache check prepare-imagefiles test-extra
.PHONY: $(ALL_PRESETS)
.DEFAULT_GOAL := list
define BIND_PRESET_DEPENDENCIES
$(1).test: $(1).build
$(1).run: $(1).build
$(1).push: $(1).test
$(1).scan: $(1).build
$(1).lint: $(1).generate
$(1).sbom: $(1).build
$(1).inspect: $(1).build
$(1).history: $(1).build
$(1).script: $(1).build
endef
$(foreach p,$(ALL_PRESETS),$(eval $(call BIND_PRESET_DEPENDENCIES,$(p))))
# Generate final image names
ifeq ($(strip $(BASE_IMAGE_PATH)),)
BASE_IMAGE_FINAL := $(BASE_IMAGE_REGISTRY)/$(BASE_IMAGE_NAME)
else
BASE_IMAGE_FINAL := $(BASE_IMAGE_REGISTRY)/$(BASE_IMAGE_PATH)/$(BASE_IMAGE_NAME)
endif
web-wasm: web-wasm/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
cp -r test web-wasm/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/web-wasm:$(TAG)-$(HOST_ARCH) \
$(TAG_FLAG) $(ORG)/web-wasm:latest-$(HOST_ARCH) \
--build-arg IMAGE=$(ORG)/web-wasm \
--build-arg VERSION=$(TAG) \
--build-arg HOST_ARCH_TAG=$(EMSCRIPTEN_HOST_ARCH_TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
web-wasm
rm -rf web-wasm/test
rm -rf $@/imagefiles
web-wasm.test: web-wasm
cp -r test web-wasm/
$(TEST_DOCKER) run $(RM) $(ORG)/web-wasm:latest-$(HOST_ARCH) > $(BIN)/dockcross-web-wasm && chmod +x $(BIN)/dockcross-web-wasm
$(BIN)/dockcross-web-wasm -i $(ORG)/web-wasm:latest-$(HOST_ARCH) python test/run.py --exe-suffix ".js"
rm -rf web-wasm/test
OUTPUT_IMAGE_FINAL := $(ORG)/$(OUTPUT_IMAGE_NAME)
#
# web-wasi-threads
#
web-wasi-threads: web-wasi web-wasi-threads/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
cp -r test web-wasi-threads/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/web-wasi-threads:$(TAG)-$(HOST_ARCH) \
-t $(ORG)/web-wasi-threads:latest-$(HOST_ARCH) \
--build-arg IMAGE=$(ORG)/web-wasi-threads \
--build-arg VERSION=$(TAG) \
# ==============================================================================
# Mandatory variables check
# ==============================================================================
MANDATORY_VARS = BASE_IMAGE_NAME BASE_IMAGE_TAG OUTPUT_IMAGE_NAME OUTPUT_IMAGE_REGISTRY \
OUTPUT_IMAGE_PATH BASE_IMAGE_REGISTRY
# ==============================================================================
# Useful functions
# ==============================================================================
define docker-tags
$(OUTPUT_IMAGE_FINAL):latest \
$(OUTPUT_IMAGE_FINAL):latest-$(HOST_ARCH) \
$(OUTPUT_IMAGE_FINAL):$(TAG)
endef
define docker-push-tags
$(OUTPUT_IMAGE_FINAL):latest \
$(OUTPUT_IMAGE_FINAL):$(TAG)
endef
define docker-run-cmd
$(DOCKER_EXEC) run --rm $(1) $(BUILDER_ENV) \
--security-opt no-new-privileges \
--mount type=bind,source=$(BIND_HOST_DIR),target=$(BIND_CONTAINER_DIR) \
--workdir $(WORKDIR) \
--mount type=tmpfs,target=/tmp,tmpfs-mode=1777,tmpfs-size=$(TMPFS_SIZE) \
--platform $(firstword $(ARCH_LIST)) \
--name $(OUTPUT_IMAGE_NAME)-$(UUID) \
$(OUTPUT_IMAGE_FINAL):latest $(2) $(3)
endef
define extra-test-run
$(DOCKER_EXEC) run --rm $(BUILDER_ENV) \
--mount type=bind,source=$(abspath $(TEST_SCRATCH_DIR)/$(1)),target=/work \
--workdir /work \
--platform $(firstword $(ARCH_LIST)) \
$(OUTPUT_IMAGE_FINAL):latest bash -c "$(2)"
endef
# ==============================================================================
# Preset targets
# ==============================================================================
.PHONY: %.all %.generate %.build %.test %.run %.push %.pull %.scan %.clean %.prune %.update %.lint %.inspect %.sbom %.script %.prepare-imagefiles \
%.rebuild %.sign %.history %.cache %.check %.test-extra \
%.test-stockfish %.test-ninja %.test-openssl %.test-C %.test-SQLite %.test-llama_cpp \
%.test-fmt %.test-cpython %.test-raylib %.test-mbedtls %.test-libopencm3
$(ALL_PRESETS): %: %.build
%.all: %.update %.generate %.build %.test %.check %.push ;
.PHONY: %.guard
%.guard:
$(foreach v,$(MANDATORY_VARS), \
$(if $(strip $($(v))),, \
$(error Missing mandatory var: $(v) (preset=$*))))
%.generate: %.guard %.clean
ifeq ($(STATIC_DOCKERFILE),yes)
@test -f $(call preset-path,$*)/Dockerfile || \
(echo "Missing committed Dockerfile for $* (STATIC_DOCKERFILE=yes)" && exit 1)
else
@echo ">>> Generating Dockerfile for $*"
@sed $(foreach f,$(DOCKER_COMPOSITE_SOURCES),\
-e '/$(f)/ r $(COMMON_DIR)/$(f)') \
$(call preset-path,$*)/Dockerfile.in > $(call preset-path,$*)/Dockerfile
endif
%.prepare-imagefiles:
@ctx="$(call build-context-dir,$*)"; \
if [ "$$ctx" != "$(PRESET_DIR)" ]; then \
mkdir -p "$$ctx/imagefiles" && cp -r $(PRESET_DIR)/imagefiles/. "$$ctx/imagefiles/"; \
fi
%.build: %.generate %.prepare-imagefiles
@$(DOCKER_EXEC) image inspect $(BASE_IMAGE_FINAL):$(BASE_IMAGE_TAG) >/dev/null 2>&1 || \
{ $(foreach d,$(DEPENDS_ON),$(MAKE) $(d);) true; }
$(DOCKER_EXEC) buildx build $(call build-context-dir,$*) \
--file $(call preset-path,$*)/Dockerfile \
--network $(DOCKER_BUILD_NETWORK) \
--platform $(PLATFORMS) --progress $(PROGRESS_OUTPUT) \
$(foreach tag,$(call docker-tags),--tag $(tag)) \
--build-arg BUILD_DATE=$(DATE) \
--build-arg ORG=$(ORG) \
--build-arg HOST_ARCH=$(HOST_ARCH) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
web-wasi-threads
#
# manylinux2014-aarch64
#
manylinux2014-aarch64: manylinux2014-aarch64/Dockerfile manylinux2014-x64
@# Register qemu
docker run --rm --privileged hypriot/qemu-register
@# Get libstdc++ from quay.io/pypa/manylinux2014_aarch64 container
docker run -v `pwd`:/host --rm -e LIB_PATH=/host/$@/xc_script/ quay.io/pypa/manylinux2014_aarch64 bash -c "PASS=1 /host/$@/xc_script/docker_setup_scrpits/copy_libstd.sh"
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux2014-aarch64:$(TAG) \
$(TAG_FLAG) $(ORG)/manylinux2014-aarch64:latest \
--build-arg IMAGE=$(ORG)/manylinux2014-aarch64 \
--build-arg IMAGE=$(ORG)/$(OUTPUT_IMAGE_NAME) \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux2014-aarch64/Dockerfile .
rm -rf $@/imagefiles
@# libstdc++ is coppied into image, now remove it
docker run -v `pwd`:/host --rm quay.io/pypa/manylinux2014_aarch64 bash -c "rm -rf /host/$@/xc_script/usr"
--build-arg VCS_REF=$(GIT_SHA) \
--build-arg VCS_URL=$(GIT_ORIGIN) \
--build-arg AUTHOR=$(AUTHOR) \
--build-arg URL=$(WEB_SITE) \
--build-arg BASE_IMAGE=$(BASE_IMAGE_FINAL):$(BASE_IMAGE_TAG) \
--build-arg BASE_IMAGE_NAME=$(BASE_IMAGE_NAME) \
--build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \
$(EXTRA_BUILD_ARGS) \
$(BUILD_IMAGE_ARGS) $(DOCKER_DRIVER)
manylinux2014-aarch64.test: manylinux2014-aarch64
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux2014-aarch64:latest > $(BIN)/dockcross-manylinux2014-aarch64 \
&& chmod +x $(BIN)/dockcross-manylinux2014-aarch64
$(BIN)/dockcross-manylinux2014-aarch64 -i $(ORG)/manylinux2014-aarch64:latest /opt/python/cp311-cp311/bin/python test/run.py
%.script: %.build
@mkdir -p $(BIN_DIR)
$(DOCKER_EXEC) run --rm $(OUTPUT_IMAGE_FINAL):latest > $(BIN_DIR)/dockcross-$* && chmod +x $(BIN_DIR)/dockcross-$*
#
# manylinux_2_28-x64
#
manylinux_2_28-x64: manylinux_2_28-x64/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux_2_28-x64:$(TAG) \
$(TAG_FLAG) $(ORG)/manylinux_2_28-x64:latest \
--build-arg IMAGE=$(ORG)/manylinux_2_28-x64 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux_2_28-x64/Dockerfile .
rm -rf $@/imagefiles
%.test: %.build %.script
$(call docker-run-cmd,,$(TEST_IMAGE_CMD),$(TEST_IMAGE_ARGS))
manylinux_2_28-x64.test: manylinux_2_28-x64
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux_2_28-x64:latest > $(BIN)/dockcross-manylinux_2_28-x64 \
&& chmod +x $(BIN)/dockcross-manylinux_2_28-x64
$(BIN)/dockcross-manylinux_2_28-x64 -i $(ORG)/manylinux_2_28-x64:latest /opt/python/cp310-cp310/bin/python test/run.py
%.run: %.build
$(call docker-run-cmd,-it,$(RUN_IMAGE_CMD),$(RUN_IMAGE_ARGS))
#
# manylinux_2_34-x64
#
manylinux_2_34-x64: manylinux_2_34-x64/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(DOCKER) build -t $(ORG)/manylinux_2_34-x64:$(TAG) \
-t $(ORG)/manylinux_2_34-x64:latest \
--build-arg IMAGE=$(ORG)/manylinux_2_34-x64 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux_2_34-x64/Dockerfile .
rm -rf $@/imagefiles
# ==============================================================================
# Extra tests
# ==============================================================================
manylinux_2_34-x64.test: manylinux_2_34-x64
$(DOCKER) run $(RM) $(ORG)/manylinux_2_34-x64:latest > $(BIN)/dockcross-manylinux_2_34-x64 \
&& chmod +x $(BIN)/dockcross-manylinux_2_34-x64
$(BIN)/dockcross-manylinux_2_34-x64 -i $(ORG)/manylinux_2_34-x64:latest /opt/python/cp310-cp310/bin/python test/run.py
%.test-extra: %.build
@$(foreach t,$(EXTRA_TESTS),$(MAKE) $*.test-$(t);)
#
# manylinux2014-x64
#
manylinux2014-x64: manylinux2014-x64/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux2014-x64:$(TAG) \
$(TAG_FLAG) $(ORG)/manylinux2014-x64:latest \
--build-arg IMAGE=$(ORG)/manylinux2014-x64 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux2014-x64/Dockerfile .
rm -rf $@/imagefiles
%.test-stockfish: %.build
rm -rf $(TEST_SCRATCH_DIR)/stockfish
git clone --depth 1 --branch sf_17.1 https://github.com/official-stockfish/Stockfish.git $(TEST_SCRATCH_DIR)/stockfish
$(call extra-test-run,stockfish,make -C src net && make -C src build $(STOCKFISH_ARGS) -j$$(nproc))
rm -rf $(TEST_SCRATCH_DIR)/stockfish
manylinux2014-x64.test: manylinux2014-x64
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux2014-x64:latest > $(BIN)/dockcross-manylinux2014-x64 \
&& chmod +x $(BIN)/dockcross-manylinux2014-x64
$(BIN)/dockcross-manylinux2014-x64 -i $(ORG)/manylinux2014-x64:latest /opt/python/cp311-cp311/bin/python test/run.py
%.test-ninja: %.build
rm -rf $(TEST_SCRATCH_DIR)/ninja
git clone --depth 1 --branch v1.11.1 https://github.com/ninja-build/ninja.git $(TEST_SCRATCH_DIR)/ninja
$(call extra-test-run,ninja,cmake -Bbuild -S. -GNinja $(NINJA_ARGS) && cmake --build build)
rm -rf $(TEST_SCRATCH_DIR)/ninja
#
# manylinux2014-x86
#
manylinux2014-x86: manylinux2014-x86/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux2014-x86:$(TAG) \
-t $(ORG)/manylinux2014-x86:latest \
--build-arg IMAGE=$(ORG)/manylinux2014-x86 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux2014-x86/Dockerfile .
rm -rf $@/imagefiles
%.test-openssl: %.build
rm -rf $(TEST_SCRATCH_DIR)/openssl
git clone --depth 1 --branch OpenSSL_1_1_1w https://github.com/openssl/openssl.git $(TEST_SCRATCH_DIR)/openssl
cd $(TEST_SCRATCH_DIR)/openssl && \
wget -q https://raw.githubusercontent.com/mavlink/MAVSDK/17ad598f0e004d225f5e939aa2947a95791f2f9b/cpp/third_party/openssl/dockcross-android.patch && \
patch -p0 < dockcross-android.patch
$(call extra-test-run,openssl,./Configure $(OPENSSL_ARGS) && make -j$$(nproc))
rm -rf $(TEST_SCRATCH_DIR)/openssl
manylinux2014-x86.test: manylinux2014-x86
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux2014-x86:latest > $(BIN)/dockcross-manylinux2014-x86 \
&& chmod +x $(BIN)/dockcross-manylinux2014-x86
$(BIN)/dockcross-manylinux2014-x86 -i $(ORG)/manylinux2014-x86:latest /opt/python/cp311-cp311/bin/python test/run.py
%.test-C: %.build
rm -rf $(TEST_SCRATCH_DIR)/C
git clone https://github.com/TheAlgorithms/C.git $(TEST_SCRATCH_DIR)/C
cd $(TEST_SCRATCH_DIR)/C && git checkout b0a41bb38c67ddebb31d3fe06d11e171410c3379
$(call extra-test-run,C,cmake -Bbuild -S. -GNinja $(C_ARGS) && cmake --build build)
rm -rf $(TEST_SCRATCH_DIR)/C
#
# base-$(HOST_ARCH)
#
base-$(HOST_ARCH): Dockerfile imagefiles/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/base:latest-$(HOST_ARCH) \
$(TAG_FLAG) $(ORG)/base:$(TAG)-$(HOST_ARCH) \
--build-arg IMAGE=$(ORG)/base \
--build-arg VCS_URL=`git config --get remote.origin.url` \
.
%.test-SQLite: %.build
rm -rf $(TEST_SCRATCH_DIR)/sqlite
git clone https://github.com/sqlite/sqlite.git $(TEST_SCRATCH_DIR)/sqlite
cd $(TEST_SCRATCH_DIR)/sqlite && git checkout 1cf61ce636915a5e92d4aa883755cee258aa98d6
$(call extra-test-run,sqlite,./configure $(SQLITE_ARGS) && make -j$$(nproc) sqlite3 sqlite3.c sqldiff)
rm -rf $(TEST_SCRATCH_DIR)/sqlite
base-$(HOST_ARCH).test: base-$(HOST_ARCH)
$(TEST_DOCKER) run $(RM) $(ORG)/base:latest-$(HOST_ARCH) > $(BIN)/dockcross-base && chmod +x $(BIN)/dockcross-base
%.test-llama_cpp: %.build
rm -rf $(TEST_SCRATCH_DIR)/llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git $(TEST_SCRATCH_DIR)/llama.cpp
cd $(TEST_SCRATCH_DIR)/llama.cpp && git checkout 76614f352e94d25659306d9e97321f204e5de0d3
$(call extra-test-run,llama.cpp,cmake -Bbuild -S. -GNinja $(LLAMA_CPP_ARGS) && cmake --build build)
rm -rf $(TEST_SCRATCH_DIR)/llama.cpp
base: Dockerfile imagefiles/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/base:latest \
$(TAG_FLAG) $(ORG)/base:$(TAG) \
--build-arg IMAGE=$(ORG)/base \
--build-arg VCS_URL=`git config --get remote.origin.url` \
.
%.test-fmt: %.build
rm -rf $(TEST_SCRATCH_DIR)/fmt
git clone --depth 1 --branch 9.1.0 https://github.com/fmtlib/fmt.git $(TEST_SCRATCH_DIR)/fmt
$(call extra-test-run,fmt,cmake -Bbuild -S. -GNinja $(FMT_ARGS) -DFMT_DOC=OFF && cmake --build build)
rm -rf $(TEST_SCRATCH_DIR)/fmt
base.test: base
$(TEST_DOCKER) run $(RM) $(ORG)/base:latest > $(BIN)/dockcross-base && chmod +x $(BIN)/dockcross-base
%.test-cpython: %.build
rm -rf $(TEST_SCRATCH_DIR)/cpython
git clone --depth 1 --branch v3.11.2 https://github.com/python/cpython.git $(TEST_SCRATCH_DIR)/cpython
$(call extra-test-run,cpython,./configure ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no --disable-ipv6 $(CPYTHON_ARGS) --build=x86_64-linux-gnu --with-build-python --enable-shared && make -j$$(nproc))
rm -rf $(TEST_SCRATCH_DIR)/cpython
%.test-raylib: %.build
rm -rf $(TEST_SCRATCH_DIR)/raylib
git clone https://github.com/raysan5/raylib.git $(TEST_SCRATCH_DIR)/raylib
cd $(TEST_SCRATCH_DIR)/raylib && git checkout a12ddacb7bfbc6e552e6145456f2fe6dfdfbe1c7
$(call extra-test-run,raylib,cmake -Bbuild -S. -GNinja $(RAYLIB_ARGS) && cmake --build build)
rm -rf $(TEST_SCRATCH_DIR)/raylib
%.test-mbedtls: %.build
rm -rf $(TEST_SCRATCH_DIR)/mbedtls
git clone --depth 1 --branch archive/baremetal https://github.com/Mbed-TLS/mbedtls.git $(TEST_SCRATCH_DIR)/mbedtls
$(call extra-test-run,mbedtls,scripts/config.pl baremetal && cmake -Bbuild -S. -GNinja $(MBEDTLS_ARGS) && cmake --build build)
rm -rf $(TEST_SCRATCH_DIR)/mbedtls
%.test-libopencm3: %.build
rm -rf $(TEST_SCRATCH_DIR)/libopencm3
git clone https://github.com/libopencm3/libopencm3.git $(TEST_SCRATCH_DIR)/libopencm3
cd $(TEST_SCRATCH_DIR)/libopencm3 && git checkout 467522778329d6f41781a6c951b77d6ff6744de6
$(call extra-test-run,libopencm3,make $(LIBOPENCM3_ARGS) -j$$(nproc))
rm -rf $(TEST_SCRATCH_DIR)/libopencm3
%.push: %.test
$(foreach tag,$(call docker-push-tags),$(DOCKER_EXEC) push $(tag) &&) true
%.pull:
$(foreach tag,$(call docker-push-tags),$(DOCKER_EXEC) pull $(tag) &&) true
%.update:
@echo ">>> Updating base image for $*"
$(DOCKER_EXEC) pull $(BASE_IMAGE_FINAL):$(BASE_IMAGE_TAG)
%.clean:
@echo "Cleaning generated Dockerfile for $*"
ifneq ($(STATIC_DOCKERFILE),yes)
@rm -f $(call preset-path,$*)/Dockerfile
endif
@ctx="$(call build-context-dir,$*)"; \
if [ "$$ctx" != "$(PRESET_DIR)" ]; then rm -rf "$$ctx/imagefiles"; fi
%.prune: %.clean
$(DOCKER_EXEC) builder prune -f --filter name=$(OUTPUT_IMAGE_FINAL)
%.inspect:
$(DOCKER_EXEC) image inspect \
$(OUTPUT_IMAGE_FINAL):latest
%.rebuild:
$(MAKE) $*.clean
$(MAKE) $*.build BUILD_IMAGE_ARGS="--no-cache"
%.history:
$(DOCKER_EXEC) history \
$(OUTPUT_IMAGE_FINAL):latest
%.sbom:
syft $(OUTPUT_IMAGE_FINAL):latest -o spdx-json > $*.sbom.json
%.sign:
cosign sign $(OUTPUT_IMAGE_FINAL):latest
%.scan:
$(DOCKER_EXEC) run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
$(TRIVY_IMAGE) \
image --severity HIGH,CRITICAL \
$(OUTPUT_IMAGE_FINAL):latest
%.lint: %.generate
$(DOCKER_EXEC) run --rm -i $(HADOLINT_IMAGE) < $(call preset-path,$*)/Dockerfile
%.check: %.lint %.scan %.sbom
%.cache:
$(DOCKER_EXEC) buildx imagetools inspect $(OUTPUT_IMAGE_FINAL):cache
# ==============================================================================
# Global targets
# ==============================================================================
.PHONY: $(PRESET_TARGETS) clean purge list display_images bash-check
%-all:
@$(foreach p,$(ALL_PRESETS),$(MAKE) $(p).$* &&) true
list:
@echo "Available presets:"
@$(foreach p,$(ALL_PRESETS),echo " - $(p)";)
# display
#
display_images:
for image in $(IMAGES); do echo $$image; done
@$(foreach p,$(filter-out base,$(ALL_PRESETS)),echo $(p);)
$(VERBOSE).SILENT: display_images
#
# build implicit rule
#
$(STANDARD_IMAGES): %: %/Dockerfile base
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/$@:latest \
$(TAG_FLAG) $(ORG)/$@:$(TAG) \
--build-arg ORG=$(ORG) \
--build-arg IMAGE=$(ORG)/$@ \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
$@
rm -rf $@/imagefiles
$(MULTIARCH_IMAGES): %: %/Dockerfile base-$(HOST_ARCH)
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/$@:latest-$(HOST_ARCH) \
$(TAG_FLAG) $(ORG)/$@:$(TAG)-$(HOST_ARCH) \
--build-arg ORG=$(ORG) \
--build-arg IMAGE=$(ORG)/$@ \
--build-arg HOST_ARCH=$(HOST_ARCH) \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
$@
rm -rf $@/imagefiles
clean:
for d in $(IMAGES) ; do rm -rf $$d/imagefiles ; done
for d in $(IMAGES) ; do rm -rf $(BIN)/dockcross-$$d ; done
for d in $(GEN_IMAGE_DOCKERFILES) ; do rm -f $$d ; done
rm -f Dockerfile
@$(foreach p,$(ALL_PRESETS),$(MAKE) $(p).clean &&) true
@rm -rf $(BIN_DIR)
purge: clean
# Remove all untagged images
$(TEST_DOCKER) container ls -aq | xargs -r $(DOCKER) container rm -f
# Remove all images with organization (ex dockcross/*)
$(BUILD_DOCKER) images --filter=reference='$(ORG)/*' --format='{{.Repository}}:{{.Tag}}' | xargs -r $(DOCKER) rmi -f
$(DOCKER_EXEC) images --filter='reference=$(ORG)/*' --format='{{.Repository}}:{{.Tag}}' | xargs -r $(DOCKER_EXEC) rmi -f
$(DOCKER_EXEC) builder prune -f
# Check bash syntax
bash-check:
find . -type f \( -name "*.sh" -o -name "*.bash" \) -print0 | xargs -0 -P"$(shell nproc)" -I{} \
$(SHELLCHECK) --check-sourced --color=auto --format=gcc --severity=warning --shell=bash --enable=all "{}"
$(DOCKER_EXEC) run --rm -v "$(PWD)":/mnt -w /mnt $(SHELLCHECK_IMAGE) --check-sourced --color=auto --format=gcc --severity=warning --shell=bash --enable=all "{}"
#
# testing implicit rule
#
.SECONDEXPANSION:
$(addsuffix .test,$(STANDARD_IMAGES)): $$(basename $$@)
$(TEST_DOCKER) run $(RM) $(ORG)/$(basename $@):latest > $(BIN)/dockcross-$(basename $@) \
&& chmod +x $(BIN)/dockcross-$(basename $@)
$(BIN)/dockcross-$(basename $@) -i $(ORG)/$(basename $@):latest python3 test/run.py $($@_ARGS)
docker-container-builder:
$(DOCKER_EXEC) buildx create --name mybuilder --use
$(DOCKER_EXEC) buildx inspect --bootstrap
$(DOCKER_EXEC) buildx inspect mybuilder
.SECONDEXPANSION:
$(addsuffix .test,$(MULTIARCH_IMAGES) web-wasi-threads): $$(basename $$@)
$(TEST_DOCKER) run $(RM) $(ORG)/$(basename $@):latest-$(HOST_ARCH) > $(BIN)/dockcross-$(basename $@) \
&& chmod +x $(BIN)/dockcross-$(basename $@)
$(BIN)/dockcross-$(basename $@) -i $(ORG)/$(basename $@):latest-$(HOST_ARCH) python3 test/run.py $($@_ARGS)
.SECONDEXPANSION:
$(addsuffix .tag-$(HOST_ARCH),$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@)
$(BUILD_DOCKER) tag $(ORG)/$(basename $@):latest-$(HOST_ARCH) \
$(ORG)/$(basename $@):$(TAG)-$(HOST_ARCH)
.SECONDEXPANSION:
$(addsuffix .push-$(HOST_ARCH),$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@)
$(BUILD_DOCKER) push $(ORG)/$(basename $@):latest-$(HOST_ARCH) \
&& $(BUILD_DOCKER) push $(ORG)/$(basename $@):$(TAG)-$(HOST_ARCH)
.SECONDEXPANSION:
$(addsuffix .push,$(STANDARD_IMAGES) $(NON_STANDARD_IMAGES)): $$(basename $$@)
$(BUILD_DOCKER) push $(ORG)/$(basename $@):latest \
&& $(BUILD_DOCKER) push $(ORG)/$(basename $@):$(TAG)
.SECONDEXPANSION:
$(addsuffix .manifest,$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@)
if $(BUILDAH) manifest exists $(ORG)/$(basename $@); then \
$(BUILDAH) manifest rm $(ORG)/$(basename $@); fi
$(BUILDAH) manifest create $(ORG)/$(basename $@)
$(BUILDAH) manifest add $(ORG)/$(basename $@) docker://$(ORG)/$(basename $@):latest-amd64
$(BUILDAH) manifest add $(ORG)/$(basename $@) docker://$(ORG)/$(basename $@):latest-arm64
.SECONDEXPANSION:
$(addsuffix .push,$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@).manifest
$(BUILDAH) manifest push --all --format v2s2 $(ORG)/$(basename $@) docker://$(ORG)/$(basename $@):latest
$(BUILDAH) manifest push --all --format v2s2 $(ORG)/$(basename $@) docker://$(ORG)/$(basename $@):$(TAG)
#
# testing prerequisites implicit rule
#
test.prerequisites:
mkdir -p $(BIN)
$(addsuffix .test,base $(IMAGES)): test.prerequisites
.PHONY: base images $(IMAGES) test %.test clean purge bash-check display_images
docker-default-builder:
$(DOCKER_EXEC) buildx use default
+440
View File
@@ -0,0 +1,440 @@
#
# Parameters
#
# Name of the docker-equivalent executable for building images.
# OCI: open container interface.
# Common values: docker, podman, buildah
DOCKER := $(or $(OCI_EXE), docker)
BUILD_DOCKER := $(or $(BUILD_DOCKER), $(DOCKER))
MANIFEST_TOOL := $(or $(MANIFEST_TOOL_EXE), manifest-tool)
RM = --rm
# Name of the docker-equivalent executable for running test containers.
# Supports the use case:
#
# DOCKER=buildah
# TEST_DOCKER=podman
#
# because buildah does not run containers.
TEST_DOCKER := $(or $(TEST_DOCKER), $(DOCKER))
# The build sub-command. Use:
#
# export "BUILD_CMD=buildx build --platform linux/amd64,linux/arm64"
#
# to generate multi-platform images.
BUILD_CMD := $(or $(BUILD_CMD), build)
TAG_FLAG := $(or $(TAG_FLAG), --tag)
# Docker organization to pull the images from
ORG = dockcross
# Host architecture
HOST_ARCH := $(or $(HOST_ARCH), $(shell uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/'))
# Directory where to generate the dockcross script for each images (e.g bin/dockcross-manylinux2014-x64)
BIN = ./bin
# These images are built using the "build implicit rule"
STANDARD_IMAGES := android-arm android-arm64 android-x86 android-x86_64 \
linux-i686 linux-x86 linux-x64 linux-x64-clang linux-arm64-musl linux-arm64-full \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-m68k-uclibc linux-s390x linux-x64-tinycc \
linux-armv6 linux-armv6-lts linux-armv6-musl linux-arm64-lts linux-mipsel-lts \
linux-armv7l-musl linux-armv7 linux-armv7a linux-armv7-lts linux-armv7a-lts linux-x86_64-full \
linux-loongarch64 linux-mips linux-mips-uclibc linux-mips-lts \
linux-ppc linux-ppc64le linux-ppc64le-lts linux-riscv64 linux-riscv32 linux-xtensa-uclibc \
windows-static-x86 windows-static-x64 windows-static-x64-posix windows-armv7 \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix windows-arm64 \
bare-armv7emhf-nano_newlib
# Generated Dockerfiles.
GEN_IMAGES := android-arm android-arm64 \
linux-i686 linux-x86 linux-x64 linux-x64-clang linux-arm64 linux-arm64-musl linux-arm64-full \
manylinux_2_28-x64 manylinux_2_34-x64 \
manylinux2014-x64 manylinux2014-x86 \
manylinux2014-aarch64 manylinux_2_28-aarch64 manylinux_2_34-aarch64 linux-arm64-lts \
web-wasm web-wasi web-wasi-emulated-threads web-wasi-threads \
linux-loongarch64 linux-mips linux-mips-uclibc linux-mips-lts windows-arm64 windows-armv7 \
windows-static-x86 windows-static-x64 windows-static-x64-posix \
windows-shared-x86 windows-shared-x64 windows-shared-x64-posix \
linux-armv7 linux-armv7a linux-armv7l-musl linux-armv7-lts linux-armv7a-lts linux-x86_64-full \
linux-armv6 linux-armv6-lts linux-armv6-musl linux-mipsel-lts \
linux-armv5 linux-armv5-musl linux-armv5-uclibc linux-ppc linux-ppc64le linux-ppc64le-lts linux-s390x \
linux-riscv64 linux-riscv32 linux-m68k-uclibc linux-x64-tinycc linux-xtensa-uclibc \
bare-armv7emhf-nano_newlib
# Generate both amd64 and arm64 images
MULTIARCH_IMAGES := linux-arm64 \
web-wasi web-wasi-emulated-threads
GEN_IMAGE_DOCKERFILES = $(addsuffix /Dockerfile,$(GEN_IMAGES))
# These images are expected to have explicit rules for *both* build and testing
NON_STANDARD_IMAGES := manylinux_2_28-x64 manylinux_2_34-x64 manylinux2014-x64 manylinux2014-x86 \
manylinux2014-aarch64 manylinux_2_28-aarch64 manylinux_2_34-aarch64 web-wasm web-wasi-emulated-threads web-wasi-threads
# Docker composite files
DOCKER_COMPOSITE_SOURCES = common.docker common.debian common.manylinux2014 common.manylinux_2_28 common.manylinux_2_34 common.buildroot \
common.crosstool common.webassembly common.windows common-manylinux.crosstool common-manylinux_2_28.crosstool common-manylinux_2_34.crosstool common.dockcross \
common.label-and-env
DOCKER_COMPOSITE_FOLDER_PATH = common/
DOCKER_COMPOSITE_PATH = $(addprefix $(DOCKER_COMPOSITE_FOLDER_PATH),$(DOCKER_COMPOSITE_SOURCES))
# This list all available images
IMAGES := $(STANDARD_IMAGES) $(NON_STANDARD_IMAGES) $(MULTIARCH_IMAGES)
# Optional arguments for test runner (test/run.py) associated with "testing implicit rule"
linux-x64-tinycc.test_ARGS = --languages C
windows-static-x86.test_ARGS = --exe-suffix ".exe"
windows-static-x64.test_ARGS = --exe-suffix ".exe"
windows-static-x64-posix.test_ARGS = --exe-suffix ".exe"
windows-shared-x86.test_ARGS = --exe-suffix ".exe"
windows-shared-x64.test_ARGS = --exe-suffix ".exe"
windows-shared-x64-posix.test_ARGS = --exe-suffix ".exe"
windows-armv7.test_ARGS = --exe-suffix ".exe"
windows-arm64.test_ARGS = --exe-suffix ".exe"
bare-armv7emhf-nano_newlib.test_ARGS = --linker-flags="--specs=nosys.specs"
# Tag images with date and Git short hash in addition to revision
TAG := $(shell date '+%Y%m%d')-$(shell git rev-parse --short HEAD)
# shellcheck executable
SHELLCHECK := shellcheck
# Defines the level of verification (error, warning, info...)
SHELLCHECK_SEVERITY_LEVEL := error
#
# images: This target builds all IMAGES (because it is the first one, it is built by default)
#
images: base $(IMAGES)
#
# test: This target ensures all IMAGES are built and run the associated tests
#
test: base.test $(addsuffix .test,$(IMAGES))
#
# Generic Targets (can specialize later).
#
$(GEN_IMAGE_DOCKERFILES) Dockerfile: %Dockerfile: %Dockerfile.in $(DOCKER_COMPOSITE_PATH)
sed $(foreach f,$(DOCKER_COMPOSITE_SOURCES),-e '/$(f)/ r $(DOCKER_COMPOSITE_FOLDER_PATH)$(f)') $< > $@
#
# web-wasm
#
ifeq ($(HOST_ARCH),amd64)
EMSCRIPTEN_HOST_ARCH_TAG = ""
endif
ifeq ($(HOST_ARCH),arm64)
EMSCRIPTEN_HOST_ARCH_TAG = "-arm64"
endif
web-wasm: web-wasm/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
cp -r test web-wasm/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/web-wasm:$(TAG)-$(HOST_ARCH) \
$(TAG_FLAG) $(ORG)/web-wasm:latest-$(HOST_ARCH) \
--build-arg IMAGE=$(ORG)/web-wasm \
--build-arg VERSION=$(TAG) \
--build-arg HOST_ARCH_TAG=$(EMSCRIPTEN_HOST_ARCH_TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
web-wasm
rm -rf web-wasm/test
rm -rf $@/imagefiles
web-wasm.test: web-wasm
cp -r test web-wasm/
$(TEST_DOCKER) run $(RM) $(ORG)/web-wasm:latest-$(HOST_ARCH) > $(BIN)/dockcross-web-wasm && chmod +x $(BIN)/dockcross-web-wasm
$(BIN)/dockcross-web-wasm -i $(ORG)/web-wasm:latest-$(HOST_ARCH) python test/run.py --exe-suffix ".js"
rm -rf web-wasm/test
#
# web-wasi-threads
#
web-wasi-threads: web-wasi web-wasi-threads/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
cp -r test web-wasi-threads/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/web-wasi-threads:$(TAG)-$(HOST_ARCH) \
-t $(ORG)/web-wasi-threads:latest-$(HOST_ARCH) \
--build-arg IMAGE=$(ORG)/web-wasi-threads \
--build-arg VERSION=$(TAG) \
--build-arg HOST_ARCH=$(HOST_ARCH) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
web-wasi-threads
#
# manylinux2014-aarch64
#
manylinux2014-aarch64: manylinux2014-aarch64/Dockerfile manylinux2014-x64
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux2014-aarch64:$(TAG) \
$(TAG_FLAG) $(ORG)/manylinux2014-aarch64:latest \
--build-arg IMAGE=$(ORG)/manylinux2014-aarch64 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux2014-aarch64/Dockerfile .
rm -rf $@/imagefiles
manylinux2014-aarch64.test: manylinux2014-aarch64
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux2014-aarch64:latest > $(BIN)/dockcross-manylinux2014-aarch64 \
&& chmod +x $(BIN)/dockcross-manylinux2014-aarch64
$(BIN)/dockcross-manylinux2014-aarch64 -i $(ORG)/manylinux2014-aarch64:latest /opt/python/cp311-cp311/bin/python test/run.py
#
# manylinux_2_28-aarch64
#
manylinux_2_28-aarch64: manylinux_2_28-aarch64/Dockerfile manylinux_2_28-x64
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux_2_28-aarch64:$(TAG) \
$(TAG_FLAG) $(ORG)/manylinux_2_28-aarch64:latest \
--build-arg IMAGE=$(ORG)/manylinux_2_28-aarch64 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
-f manylinux_2_28-aarch64/Dockerfile .
rm -rf $@/imagefiles
manylinux_2_28-aarch64.test: manylinux_2_28-aarch64
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux_2_28-aarch64:latest > $(BIN)/dockcross-manylinux_2_28-aarch64 \
&& chmod +x $(BIN)/dockcross-manylinux_2_28-aarch64
$(BIN)/dockcross-manylinux_2_28-aarch64 -i $(ORG)/manylinux_2_28-aarch64:latest /opt/python/cp311-cp311/bin/python test/run.py
#
# manylinux_2_34-aarch64
#
manylinux_2_34-aarch64: manylinux_2_34-aarch64/Dockerfile manylinux_2_34-x64
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux_2_34-aarch64:$(TAG) \
$(TAG_FLAG) $(ORG)/manylinux_2_34-aarch64:latest \
--build-arg IMAGE=$(ORG)/manylinux_2_34-aarch64 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux_2_34-aarch64/Dockerfile .
rm -rf $@/imagefiles
manylinux_2_34-aarch64.test: manylinux_2_34-aarch64
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux_2_34-aarch64:latest > $(BIN)/dockcross-manylinux_2_34-aarch64 \
&& chmod +x $(BIN)/dockcross-manylinux_2_34-aarch64
$(BIN)/dockcross-manylinux_2_34-aarch64 -i $(ORG)/manylinux_2_34-aarch64:latest /opt/python/cp311-cp311/bin/python test/run.py
#
# manylinux_2_28-x64
#
manylinux_2_28-x64: manylinux_2_28-x64/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux_2_28-x64:$(TAG) \
$(TAG_FLAG) $(ORG)/manylinux_2_28-x64:latest \
--build-arg IMAGE=$(ORG)/manylinux_2_28-x64 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux_2_28-x64/Dockerfile .
rm -rf $@/imagefiles
manylinux_2_28-x64.test: manylinux_2_28-x64
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux_2_28-x64:latest > $(BIN)/dockcross-manylinux_2_28-x64 \
&& chmod +x $(BIN)/dockcross-manylinux_2_28-x64
$(BIN)/dockcross-manylinux_2_28-x64 -i $(ORG)/manylinux_2_28-x64:latest /opt/python/cp310-cp310/bin/python test/run.py
#
# manylinux_2_34-x64
#
manylinux_2_34-x64: manylinux_2_34-x64/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(DOCKER) build -t $(ORG)/manylinux_2_34-x64:$(TAG) \
-t $(ORG)/manylinux_2_34-x64:latest \
--build-arg IMAGE=$(ORG)/manylinux_2_34-x64 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux_2_34-x64/Dockerfile .
rm -rf $@/imagefiles
manylinux_2_34-x64.test: manylinux_2_34-x64
$(DOCKER) run $(RM) $(ORG)/manylinux_2_34-x64:latest > $(BIN)/dockcross-manylinux_2_34-x64 \
&& chmod +x $(BIN)/dockcross-manylinux_2_34-x64
$(BIN)/dockcross-manylinux_2_34-x64 -i $(ORG)/manylinux_2_34-x64:latest /opt/python/cp310-cp310/bin/python test/run.py
#
# manylinux2014-x64
#
manylinux2014-x64: manylinux2014-x64/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux2014-x64:$(TAG) \
$(TAG_FLAG) $(ORG)/manylinux2014-x64:latest \
--build-arg IMAGE=$(ORG)/manylinux2014-x64 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux2014-x64/Dockerfile .
rm -rf $@/imagefiles
manylinux2014-x64.test: manylinux2014-x64
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux2014-x64:latest > $(BIN)/dockcross-manylinux2014-x64 \
&& chmod +x $(BIN)/dockcross-manylinux2014-x64
$(BIN)/dockcross-manylinux2014-x64 -i $(ORG)/manylinux2014-x64:latest /opt/python/cp311-cp311/bin/python test/run.py
#
# manylinux2014-x86
#
manylinux2014-x86: manylinux2014-x86/Dockerfile
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux2014-x86:$(TAG) \
-t $(ORG)/manylinux2014-x86:latest \
--build-arg IMAGE=$(ORG)/manylinux2014-x86 \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux2014-x86/Dockerfile .
rm -rf $@/imagefiles
manylinux2014-x86.test: manylinux2014-x86
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux2014-x86:latest > $(BIN)/dockcross-manylinux2014-x86 \
&& chmod +x $(BIN)/dockcross-manylinux2014-x86
$(BIN)/dockcross-manylinux2014-x86 -i $(ORG)/manylinux2014-x86:latest /opt/python/cp311-cp311/bin/python test/run.py
#
# base-$(HOST_ARCH)
#
base-$(HOST_ARCH): Dockerfile imagefiles/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/base:latest-$(HOST_ARCH) \
$(TAG_FLAG) $(ORG)/base:$(TAG)-$(HOST_ARCH) \
--build-arg IMAGE=$(ORG)/base \
--build-arg VCS_URL=`git config --get remote.origin.url` \
.
base-$(HOST_ARCH).test: base-$(HOST_ARCH)
$(TEST_DOCKER) run $(RM) $(ORG)/base:latest-$(HOST_ARCH) > $(BIN)/dockcross-base && chmod +x $(BIN)/dockcross-base
base: Dockerfile imagefiles/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/base:latest \
$(TAG_FLAG) $(ORG)/base:$(TAG) \
--build-arg IMAGE=$(ORG)/base \
--build-arg VCS_URL=`git config --get remote.origin.url` \
.
base.test: base
$(TEST_DOCKER) run $(RM) $(ORG)/base:latest > $(BIN)/dockcross-base && chmod +x $(BIN)/dockcross-base
# display
#
display_images:
for image in $(IMAGES); do echo $$image; done
$(VERBOSE).SILENT: display_images
#
# build implicit rule
#
$(STANDARD_IMAGES): %: %/Dockerfile base
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/$@:latest \
$(TAG_FLAG) $(ORG)/$@:$(TAG) \
--build-arg ORG=$(ORG) \
--build-arg IMAGE=$(ORG)/$@ \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
$@
rm -rf $@/imagefiles
$(MULTIARCH_IMAGES): %: %/Dockerfile base-$(HOST_ARCH)
mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/$@:latest-$(HOST_ARCH) \
$(TAG_FLAG) $(ORG)/$@:$(TAG)-$(HOST_ARCH) \
--build-arg ORG=$(ORG) \
--build-arg IMAGE=$(ORG)/$@ \
--build-arg HOST_ARCH=$(HOST_ARCH) \
--build-arg VERSION=$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VCS_URL=`git config --get remote.origin.url` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
$@
rm -rf $@/imagefiles
clean:
for d in $(IMAGES) ; do rm -rf $$d/imagefiles ; done
for d in $(IMAGES) ; do rm -rf $(BIN)/dockcross-$$d ; done
for d in $(GEN_IMAGE_DOCKERFILES) ; do rm -f $$d ; done
rm -f Dockerfile
purge: clean
# Remove all untagged images
$(TEST_DOCKER) container ls -aq | xargs -r $(DOCKER) container rm -f
# Remove all images with organization (ex dockcross/*)
$(BUILD_DOCKER) images --filter=reference='$(ORG)/*' --format='{{.Repository}}:{{.Tag}}' | xargs -r $(DOCKER) rmi -f
# Check bash syntax
bash-check:
find . -type f \( -name "*.sh" -o -name "*.bash" \) -print0 | xargs -0 -P"$(shell nproc)" -I{} \
$(SHELLCHECK) --check-sourced --color=auto --format=gcc --severity=warning --shell=bash --enable=all "{}"
#
# testing implicit rule
#
.SECONDEXPANSION:
$(addsuffix .test,$(STANDARD_IMAGES)): $$(basename $$@)
$(TEST_DOCKER) run $(RM) $(ORG)/$(basename $@):latest > $(BIN)/dockcross-$(basename $@) \
&& chmod +x $(BIN)/dockcross-$(basename $@)
$(BIN)/dockcross-$(basename $@) -i $(ORG)/$(basename $@):latest python3 test/run.py $($@_ARGS)
.SECONDEXPANSION:
$(addsuffix .test,$(MULTIARCH_IMAGES) web-wasi-threads): $$(basename $$@)
$(TEST_DOCKER) run $(RM) $(ORG)/$(basename $@):latest-$(HOST_ARCH) > $(BIN)/dockcross-$(basename $@) \
&& chmod +x $(BIN)/dockcross-$(basename $@)
$(BIN)/dockcross-$(basename $@) -i $(ORG)/$(basename $@):latest-$(HOST_ARCH) python3 test/run.py $($@_ARGS)
.SECONDEXPANSION:
$(addsuffix .tag-$(HOST_ARCH),$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@)
$(BUILD_DOCKER) tag $(ORG)/$(basename $@):latest-$(HOST_ARCH) \
$(ORG)/$(basename $@):$(TAG)-$(HOST_ARCH)
.SECONDEXPANSION:
$(addsuffix .push-$(HOST_ARCH),$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@)
$(BUILD_DOCKER) push $(ORG)/$(basename $@):latest-$(HOST_ARCH) \
&& $(BUILD_DOCKER) push $(ORG)/$(basename $@):$(TAG)-$(HOST_ARCH)
.SECONDEXPANSION:
$(addsuffix .push,$(STANDARD_IMAGES) $(NON_STANDARD_IMAGES)): $$(basename $$@)
$(BUILD_DOCKER) push $(ORG)/$(basename $@):latest \
&& $(BUILD_DOCKER) push $(ORG)/$(basename $@):$(TAG)
.SECONDEXPANSION:
$(addsuffix .manifest,$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@)
$(MANIFEST_TOOL) push from-args \
--platforms linux/amd64,linux/arm64 \
--template $(ORG)/$(basename $@):latest-ARCH \
--target $(ORG)/$(basename $@):latest
.SECONDEXPANSION:
$(addsuffix .push,$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@).manifest
$(MANIFEST_TOOL) push from-args \
--platforms linux/amd64,linux/arm64 \
--template $(ORG)/$(basename $@):$(TAG)-ARCH \
--target $(ORG)/$(basename $@):$(TAG)
#
# testing prerequisites implicit rule
#
test.prerequisites:
mkdir -p $(BIN)
$(addsuffix .test,base $(IMAGES)): test.prerequisites
.PHONY: base images $(IMAGES) test %.test clean purge bash-check display_images
+29
View File
@@ -103,6 +103,7 @@ The dockcross script will execute the given command-line inside the container, a
| dockcross/linux-armv7-lts | ARMv7 | GCC 8.5.0 + Glibc 2.28 | Linux |
| dockcross/linux-armv7a | ARMv7a | GCC | Linux |
| dockcross/linux-armv7l-musl | ARMv7l | GCC + musl | Linux |
| dockcross/linux-loongarch64 | LoongArch64 | GCC | Linux |
| dockcross/linux-mips | mips | GCC | Linux |
| dockcross/linux-mips-uclibc | mips | GCC + uclibc | Linux |
| dockcross/linux-mips-lts | mips | GCC 8.5.0 + Glibc 2.28 | Linux |
@@ -116,7 +117,9 @@ The dockcross script will execute the given command-line inside the container, a
| dockcross/linux-m68k-uclibc | m68k | GCC + uclibc | Linux |
| dockcross/linux-xtensa-uclibc | xtensa | GCC + uclibc | Linux |
| dockcross/manylinux_2_28-x64 | x86_64 | GCC | Linux |
| dockcross/manylinux_2_28-aarch64 | aarch64 | GCC | Linux |
| dockcross/manylinux_2_34-x64 | x86_64 | GCC | Linux |
| dockcross/manylinux_2_34-aarch64 | ARMv8 | GCC | Linux |
| dockcross/manylinux2014-x86 | x86 | GCC | Linux |
| dockcross/manylinux2014-x64 | x86_64 | GCC | Linux |
| dockcross/linux-i686 | x86 | GCC | Linux |
@@ -281,6 +284,12 @@ board PC with TI SoC AM3358 on board, Cortex-A8.
Toolchain configured for ARMv7-L, using
[musl](https://www.musl-libc.org/) as base \"libc\".
### dockcross/linux-loongarch64
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/dockcross/linux-loongarch64/latest) ![Docker Pulls](https://img.shields.io/docker/pulls/dockcross/linux-loongarch64)
Generic Linux LoongArch64 cross compiler toolchain.
### dockcross/linux-mips
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/dockcross/linux-mips/latest) ![Docker Pulls](https://img.shields.io/docker/pulls/dockcross/linux-mips)
@@ -385,12 +394,24 @@ Standalone Linux i686 cross compiler.
Docker [manylinux_2_28](https://github.com/pypa/manylinux) image for building Linux x86_64 / amd64 [Python wheel packages](http://pythonwheels.com/). It includes Python 3.6, 3.7, 3.8, 3.9, 3.10 and 3.11. Also has support for the dockcross script, and it has installations of CMake, Ninja, and [scikit-build](http://scikit-build.org). For CMake, it sets **MANYLINUX_2_28** to \"TRUE\" in the toolchain.
### dockcross/manylinux_2_28-aarch64
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/dockcross/manylinux_2_28-aarch64/latest) ![Docker Pulls](https://img.shields.io/docker/pulls/dockcross/manylinux_2_28-aarch64)
Docker [manylinux_2_28](https://github.com/pypa/manylinux) image for building Linux aarch64 / arm64 [Python wheel packages](http://pythonwheels.com/). It includes Python 3.6, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14. Also has support for the dockcross script, and it has installations of CMake, Ninja, and [scikit-build](http://scikit-build.org). For CMake, it sets **MANYLINUX_2_28** to \"TRUE\" in the toolchain.
### dockcross/manylinux_2_34-x64
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/dockcross/manylinux_2_34-x64/latest) ![Docker Pulls](https://img.shields.io/docker/pulls/dockcross/manylinux_2_34-x64)
Docker [manylinux_2_34](https://github.com/pypa/manylinux) image for building Linux x86_64 / amd64 [Python wheel packages](http://pythonwheels.com/). It includes Python 3.8.10+, 3.9.5+, 3.10.0+. Also has support for the dockcross script, and it has installations of CMake, Ninja, and [scikit-build](http://scikit-build.org). For CMake, it sets **MANYLINUX_2_34** to \"TRUE\" in the toolchain.
### dockcross/manylinux_2_34-aarch64
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/dockcross/manylinux_2_34-aarch64/latest) ![Docker Pulls](https://img.shields.io/docker/pulls/dockcross/manylinux_2_34-aarch64)
Docker [manylinux_2_34](https://github.com/pypa/manylinux) image for building Linux aarch64 / arm64 [Python wheel packages](http://pythonwheels.com/). It includes CPython 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.13t (free-threaded) and PyPy 3.10. Also has support for the dockcross script, and it has installations of CMake, Ninja, and [scikit-build](http://scikit-build.org). For CMake, it sets **MANYLINUX_2_34** to "TRUE" in the toolchain. This image is designed to run on x86_64 hosts and cross-compile for aarch64 targets using QEMU emulation.
### dockcross/manylinux2014-x64
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/dockcross/manylinux2014-x64/latest) ![Docker Pulls](https://img.shields.io/docker/pulls/dockcross/manylinux2014-x64)
@@ -620,6 +641,14 @@ Note that the architecture is now `aarch64` instead of `amd64`, so it runs nativ
\-\--
## Multi-architecture Image Creation
For creating multi-architecture container images, this project uses [manifest-tool](https://github.com/estesp/manifest-tool) to create and manage manifest lists that combine platform-specific images into a single multi-platform reference. This allows container runtimes to automatically select the appropriate image based on the target architecture.
The multi-architecture images are built on different architectures (amd64 and arm64) and then combined using manifest-tool's `push from-args` command, which creates manifest lists pointing to the individual platform-specific images.
---
Credits:
- [sdt/docker-raspberry-pi-cross-compiler](https://github.com/sdt/docker-raspberry-pi-cross-compiler), who invented the base of the **dockcross** script.
+2 -2
View File
@@ -17,8 +17,8 @@ ENV AS=${CROSS_ROOT}/bin/llvm-as \
CXX=${CROSS_ROOT}/bin/clang++ \
LD=${CROSS_ROOT}/bin/ld
ENV ANDROID_NDK_REVISION=25b
ENV ANDROID_API=23
ENV ANDROID_NDK_REVISION=28b
ENV ANDROID_API=24
RUN mkdir -p /build && \
cd /build && \
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = android-arm
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish openssl SQLite
STOCKFISH_ARGS = ARCH=armv7 COMP=ndk
OPENSSL_ARGS = android-arm no-shared
+2 -2
View File
@@ -21,8 +21,8 @@ ENV AS=${CROSS_ROOT}/bin/llvm-as \
CXX=${CROSS_ROOT}/bin/clang++ \
LD=${CROSS_ROOT}/bin/ld
ENV ANDROID_NDK_REVISION=25b
ENV ANDROID_API=23
ENV ANDROID_NDK_REVISION=28b
ENV ANDROID_API=24
RUN mkdir -p /build && \
cd /build && \
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = android-arm64
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish openssl SQLite
STOCKFISH_ARGS = ARCH=armv8 COMP=ndk
OPENSSL_ARGS = android-arm64 no-shared
+4 -3
View File
@@ -1,4 +1,5 @@
FROM dockcross/base:latest
ARG ORG=dockcross
FROM ${ORG}/base:latest
RUN apt-get update && apt-get install -y unzip
@@ -11,8 +12,8 @@ ENV AS=${CROSS_ROOT}/bin/llvm-as \
CXX=${CROSS_ROOT}/bin/clang++ \
LD=${CROSS_ROOT}/bin/ld
ENV ANDROID_NDK_REVISION=25b
ENV ANDROID_API=23
ENV ANDROID_NDK_REVISION=28b
ENV ANDROID_API=24
RUN mkdir -p /build && \
cd /build && \
+15
View File
@@ -0,0 +1,15 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = android-x86
STATIC_DOCKERFILE = yes
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish openssl SQLite
STOCKFISH_ARGS = ARCH=x86-32 COMP=ndk
OPENSSL_ARGS = android-x86 no-shared
+4 -3
View File
@@ -1,4 +1,5 @@
FROM dockcross/base:latest
ARG ORG=dockcross
FROM ${ORG}/base:latest
RUN apt-get update && apt-get install -y unzip
@@ -11,8 +12,8 @@ ENV AS=${CROSS_ROOT}/bin/llvm-as \
CXX=${CROSS_ROOT}/bin/clang++ \
LD=${CROSS_ROOT}/bin/ld
ENV ANDROID_NDK_REVISION=25b
ENV ANDROID_API=23
ENV ANDROID_NDK_REVISION=28b
ENV ANDROID_API=24
RUN mkdir -p /build && \
cd /build && \
+15
View File
@@ -0,0 +1,15 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = android-x86_64
STATIC_DOCKERFILE = yes
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish openssl SQLite
STOCKFISH_ARGS = ARCH=x86-64 COMP=ndk
OPENSSL_ARGS = android-x86_64 no-shared
@@ -822,9 +822,9 @@ CT_ZLIB_PATCH_GLOBAL=y
# CT_ZLIB_PATCH_LOCAL_BUNDLED is not set
# CT_ZLIB_PATCH_NONE is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = bare-armv7emhf-nano_newlib
TEST_IMAGE_ARGS = --linker-flags="--specs=nosys.specs"
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = mbedtls libopencm3
LIBOPENCM3_ARGS = PREFIX=/usr/xcc/arm-none-eabi/bin/arm-none-eabi- TARGETS='stm32/f1 stm32/f2 stm32/f3 stm32/f4 stm32/f7 stm32/l1 stm32/l4 stm32/g4 stm32/h7 gd32/f1x0 lpc13xx lpc17xx lpc43xx/m4 lm3s lm4f msp432/e4 efm32/tg efm32/g efm32/lg efm32/gg efm32/wg efm32/ezr32wg nrf/51 nrf/52 sam/3a sam/3n sam/3s sam/3u sam/3x sam/4l vf6xx pac55xx'
+76
View File
@@ -0,0 +1,76 @@
# crosstool.common-manylinux_2_28
#
# Common Docker instructions to install "crosstool-ng" and build a full
# cross-compiler suite from a crosstool-ng configuration, CROSSTOOL_CONFIG.
#
# This import complements the "dockcross/base" image, adding:
# - "ct-ng", a cross-compiler building utilty.
# - A cross-compiler suite configured in "crosstool-ng.config".
#
# The generated cross-compiler will have a CROSS_ROOT of:
# ${XCC_PREFIX}/${CROSS_TRIPLE}
#
# A given platform will need to supply the appropriate "crosstool-ng.config" to
# generate its cross-compiler. This can be built using "ct-ng menuconfig" to
# generate a configuration.
ENV MANYLINUX_DEPS="glibc-devel glibc-devel.i686 libstdc++-devel glib2-devel libX11-devel libXext-devel libXrender-devel mesa-libGL-devel libICE-devel libSM-devel"
ENV PYTHON_COMPILE_DEPS="python3-devel zlib-devel bzip2-devel expat-devel ncurses-devel readline-devel tk-devel gdbm-devel libdb-devel libpcap-devel xz-devel openssl-devel keyutils-libs-devel krb5-devel libcom_err-devel libidn-devel curl-devel perl-devel"
ENV TOOLCHAIN_DEPS="gcc-toolset-14-binutils gcc-toolset-14-gcc gcc-toolset-14-gcc-c++ gcc-toolset-14-gcc-gfortran"
# Install dependent packages required for `ct-ng`.
RUN \
yum -y update && \
yum -y install \
gawk \
gperf \
help2man \
texinfo \
flex \
ncurses-devel \
glibc-static \
rsync \
systemtap-devel \
systemtap-sdt-devel \
${TOOLCHAIN_DEPS} \
${PYTHON_COMPILE_DEPS} \
${MANYLINUX_DEPS} && \
yum clean all
ENV XCC_PREFIX=/usr/xcc
# Add the crosstool-ng script and image-specific toolchain configuration into
# /dockcross/.
#
# Afterwards, we will leave the "ct-ng" config in the image as a reference
# for users.
COPY \
imagefiles/install-crosstool-ng-toolchain.sh \
imagefiles/patch/crosstool-ng/crosstool-ng-zlib-target.patch \
manylinux_2_28-aarch64/crosstool-ng.config \
/dockcross/
# Copy sys/sdt.h to a clean include directory to avoid pulling in all of
# /usr/include (which causes __float128 conflicts on AlmaLinux 8 when
# cross-compiling for aarch64).
RUN mkdir -p /opt/ct-ng-includes/sys && \
cp /usr/include/sys/sdt.h /opt/ct-ng-includes/sys/ && \
cp /usr/include/sys/sdt-config.h /opt/ct-ng-includes/sys/
# Build and install the toolchain, cleaning up artifacts afterwards.
RUN \
mkdir /dockcross/crosstool && \
cd /dockcross/crosstool && \
/dockcross/install-crosstool-ng-toolchain.sh \
-p "${XCC_PREFIX}" \
-c /dockcross/crosstool-ng.config \
-v "${CT_VERSION}" && \
rm -rf /dockcross/crosstool /dockcross/install-crosstool-ng-toolchain.sh && \
# Remove sudo provided by gcc-toolset since it doesn't work with
# our sudo wrapper calling gosu.
rm -f /opt/rh/gcc-toolset-14/root/usr/bin/sudo
# Restore our default workdir (from "dockcross/base").
WORKDIR /work
+76
View File
@@ -0,0 +1,76 @@
# crosstool.common-manylinux_2_34
#
# Common Docker instructions to install "crosstool-ng" and build a full
# cross-compiler suite from a crosstool-ng configuration, CROSSTOOL_CONFIG.
#
# This import complements the "dockcross/base" image, adding:
# - "ct-ng", a cross-compiler building utilty.
# - A cross-compiler suite configured in "crosstool-ng.config".
#
# The generated cross-compiler will have a CROSS_ROOT of:
# ${XCC_PREFIX}/${CROSS_TRIPLE}
#
# A given platform will need to supply the appropriate "crosstool-ng.config" to
# generate its cross-compiler. This can be built using "ct-ng menuconfig" to
# generate a configuration.
ENV MANYLINUX_DEPS="glibc-devel glibc-devel.i686 libstdc++-devel glib2-devel libX11-devel libXext-devel libXrender-devel mesa-libGL-devel libICE-devel libSM-devel"
ENV PYTHON_COMPILE_DEPS="python-devel zlib-devel bzip2-devel expat-devel ncurses-devel readline-devel tk-devel gdbm-devel libdb-devel libpcap-devel xz-devel openssl-devel keyutils-libs-devel krb5-devel libcom_err-devel libidn-devel curl-devel perl-devel"
ENV TOOLCHAIN_DEPS="gcc-toolset-14-binutils gcc-toolset-14-gcc gcc-toolset-14-gcc-c++ gcc-toolset-14-gcc-gfortran"
# Install dependent packages required for `ct-ng`.
RUN \
dnf -y update && \
dnf -y install \
gawk \
gperf \
help2man \
texinfo \
flex \
ncurses-devel \
glibc-static \
rsync \
systemtap-devel \
systemtap-sdt-devel \
${TOOLCHAIN_DEPS} \
${PYTHON_COMPILE_DEPS} \
${MANYLINUX_DEPS} && \
dnf clean all
ENV XCC_PREFIX=/usr/xcc
# Add the crosstool-ng script and image-specific toolchain configuration into
# /dockcross/.
#
# Afterwards, we will leave the "ct-ng" config in the image as a reference
# for users.
COPY \
imagefiles/install-crosstool-ng-toolchain.sh \
imagefiles/patch/crosstool-ng/crosstool-ng-zlib-target.patch \
manylinux_2_34-aarch64/crosstool-ng.config \
/dockcross/
# Copy sys/sdt.h to a clean include directory to avoid pulling in all of
# /usr/include (which causes __float128 conflicts on AlmaLinux 9 when
# cross-compiling for aarch64).
RUN mkdir -p /opt/ct-ng-includes/sys && \
cp /usr/include/sys/sdt.h /opt/ct-ng-includes/sys/ && \
cp /usr/include/sys/sdt-config.h /opt/ct-ng-includes/sys/
# Build and install the toolchain, cleaning up artifacts afterwards.
RUN \
mkdir /dockcross/crosstool && \
cd /dockcross/crosstool && \
/dockcross/install-crosstool-ng-toolchain.sh \
-p "${XCC_PREFIX}" \
-c /dockcross/crosstool-ng.config \
-v "${CT_VERSION}" && \
rm -rf /dockcross/crosstool /dockcross/install-crosstool-ng-toolchain.sh && \
# Remove sudo provided by gcc-toolset since it doesn't work with
# our sudo wrapper calling gosu.
rm -f /opt/rh/gcc-toolset-14/root/usr/bin/sudo
# Restore our default workdir (from "dockcross/base").
WORKDIR /work
+5
View File
@@ -18,6 +18,9 @@ ARG CURL_HASH=3b4378156ba09e224008e81dcce854b7ce4d182b1f9cfb97fe5ed9e9c18c6bd3
ARG PERL_VERSION=perl-5.40.1
ARG PERL_HASH=02f8c45bb379ed0c3de7514fad48c714fd46be8f0b536bfd5320050165a1ee26
ENV RUSTUP_HOME=/opt/rustup
ENV CARGO_HOME=/opt/rustup/cargo
# Image build scripts
COPY \
imagefiles/build-and-install-cmake.sh \
@@ -49,6 +52,8 @@ RUN \
/buildscripts/build-and-install-flatcc.sh && \
rm -rf /buildscripts
ENV PATH=/opt/rustup/cargo/bin:$PATH
RUN echo "root:root" | chpasswd
WORKDIR /work
ENTRYPOINT ["/dockcross/entrypoint.sh"]
+3 -1
View File
@@ -10,6 +10,8 @@ RUN \
wget \
nasm \
zip \
perl-IPC-Cmd \
perl-Time-Piece \
&& \
yum clean all
@@ -22,7 +24,7 @@ RUN \
set -x && \
# Remove sudo provided by devtoolset since it doesn't work with
# our sudo wrapper calling gosu.
rm -f /opt/rh/gcc-toolset-12/root/usr/bin/sudo && \
rm -f /opt/rh/gcc-toolset-14/root/usr/bin/sudo && \
/buildscripts/install-python-packages.sh && \
rm -rf /buildscripts
+5
View File
@@ -10,6 +10,11 @@ RUN \
wget \
nasm \
zip \
perl-FindBin \
perl-File-Compare \
perl-File-Copy \
perl-IPC-Cmd \
perl-Time-Piece \
&& \
yum clean all
+5 -1
View File
@@ -46,7 +46,11 @@ RUN git clone --recurse-submodules https://github.com/WebAssembly/wabt.git && \
RUN mkdir -p /wasi-runtimes
ENV WASMTIME_HOME=/wasi-runtimes/wasmtime
RUN mkdir -p ${WASMTIME_HOME} && curl https://wasmtime.dev/install.sh -sSf | bash
# Pinned below v47.0.0: that release removes wasi-threads/wasi-common support
# entirely (see https://github.com/bytecodealliance/rfcs/pull/47), which
# wasmtime-pwd-threads.sh and the wasi-threads images below depend on.
ENV WASMTIME_VERSION=v46.0.1
RUN mkdir -p ${WASMTIME_HOME} && curl https://wasmtime.dev/install.sh -sSf | bash -s -- --version ${WASMTIME_VERSION}
COPY imagefiles/wasmtime-pwd.sh ${WASMTIME_HOME}/bin/
COPY imagefiles/wasmtime-pwd-threads.sh ${WASMTIME_HOME}/bin/
ENV PATH="$WASMTIME_HOME/bin:$PATH"
+15 -23
View File
@@ -2,8 +2,11 @@
set -ex
MY_DIR=$(dirname "${BASH_SOURCE[0]}")
source $MY_DIR/utils.sh
# Get script directory
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
# Get build utilities
source $SCRIPT_DIR/utils.sh
#
# Function 'do_curl_build' and 'build_curl'
@@ -20,6 +23,7 @@ if [[ -z "${CURL_HASH}" ]]; then
exit 1
fi
CURL_ROOT="${CURL_VERSION}"
CURL_DOWNLOAD_URL=https://curl.haxx.se/download
function do_curl_build {
@@ -30,28 +34,16 @@ function do_curl_build {
make install > /dev/null
}
function build_curl {
local curl_fname=$1
check_var ${curl_fname}
local curl_sha256=$2
check_var ${curl_sha256}
check_var ${CURL_DOWNLOAD_URL}
curl --connect-timeout 30 \
--max-time 10 \
--retry 5 \
--retry-delay 10 \
--retry-max-time 30 \
-fsSLO ${CURL_DOWNLOAD_URL}/${curl_fname}.tar.gz
check_sha256sum ${curl_fname}.tar.gz ${curl_sha256}
tar -zxf ${curl_fname}.tar.gz
(cd curl-*/ && do_curl_build)
rm -rf curl-*
}
cd /usr/src
build_curl "${CURL_VERSION}" "${CURL_HASH}"
fetch_source "${CURL_ROOT}.tar.gz" "${CURL_DOWNLOAD_URL}"
check_sha256sum "${CURL_ROOT}.tar.gz" "${CURL_HASH}"
tar -zxf "${CURL_ROOT}.tar.gz"
pushd "${CURL_ROOT}"
do_curl_build
popd
rm -rf "${CURL_ROOT}" "${CURL_ROOT}.tar.gz"
(cat /etc/ld.so.conf.d/usr-local.conf 2> /dev/null | grep -q "^/usr/local/lib$") ||
echo '/usr/local/lib' >> /etc/ld.so.conf.d/usr-local.conf
+14 -19
View File
@@ -2,10 +2,12 @@
set -ex
if ! command -v curl &> /dev/null; then
echo >&2 'error: "curl" not found!'
exit 1
fi
# Get script directory
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
# Get build utilities
source $SCRIPT_DIR/utils.sh
if ! command -v tar &> /dev/null; then
echo >&2 'error: "tar" not found!'
@@ -23,27 +25,20 @@ ldconfig
cd /usr/src
url="https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz"
echo "Downloading $url"
curl --connect-timeout 20 \
--max-time 10 \
--retry 5 \
--retry-delay 10 \
--retry-max-time 40 \
-# -LO $url
GIT_ROOT="git-${GIT_VERSION}"
GIT_DOWNLOAD_URL="https://mirrors.edge.kernel.org/pub/software/scm/git"
tar xvzf "git-${GIT_VERSION}.tar.gz" --no-same-owner
rm -f "git-${GIT_VERSION}.tar.gz"
fetch_source "${GIT_ROOT}.tar.gz" "${GIT_DOWNLOAD_URL}"
tar xvzf "${GIT_ROOT}.tar.gz" --no-same-owner
pushd "git-${GIT_VERSION}"
pushd "${GIT_ROOT}"
./configure --prefix=/usr/local --with-curl
make -j"$(nproc)"
make install
make -j"$(nproc)" NO_GETTEXT=YesPlease
make NO_GETTEXT=YesPlease install
popd
rm -rf "${GIT_ROOT}" "${GIT_ROOT}.tar.gz"
ldconfig
rm -rf "git-${GIT_VERSION}"
# turn the detached message off
git config --global advice.detachedHead false
+14 -11
View File
@@ -10,6 +10,12 @@
set -e
set -o pipefail
# Get script directory
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
# Get build utilities
source $SCRIPT_DIR/utils.sh
PYTHON=python
while [ $# -gt 0 ]; do
case "$1" in
@@ -31,25 +37,22 @@ if [[ -z "${NINJA_VERSION}" ]]; then
fi
# Download
url="https://github.com/ninja-build/ninja/archive/v${NINJA_VERSION}.tar.gz"
NINJA_DOWNLOAD_URL="https://github.com/ninja-build/ninja/archive/"
NINJA_ROOT="v${NINJA_VERSION}"
curl --connect-timeout 30 \
--max-time 10 \
--retry 5 \
--retry-delay 10 \
--retry-max-time 30 \
-# -o ninja.tar.gz -LO "$url"
fetch_source "${NINJA_ROOT}.tar.gz" "${NINJA_DOWNLOAD_URL}"
mkdir ninja
tar -xzvf ./ninja.tar.gz --strip-components=1 -C ./ninja
# Since the archive name doesn't match the top-level directory, explicitly specify it.
mkdir -p "${NINJA_ROOT}"
tar xvzf "${NINJA_ROOT}.tar.gz" --strip-components=1 -C "${NINJA_ROOT}"
# Configure, build and install
pushd ./ninja
pushd "${NINJA_ROOT}"
echo "Configuring ninja using [$PYTHON]"
$PYTHON ./configure.py --bootstrap && ./ninja
cp ./ninja /usr/bin/
popd
# Clean
rm -rf ./ninja*
rm -rf "${NINJA_ROOT}" "${NINJA_ROOT}.tar.gz"
+7 -14
View File
@@ -39,8 +39,11 @@ while [ $# -gt 0 ]; do
shift
done
MY_DIR=$(dirname "${BASH_SOURCE[0]}")
source $MY_DIR/utils.sh
# Get script directory
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
# Get build utilities
source $SCRIPT_DIR/utils.sh
#
# Function 'do_openssl_build' and 'build_openssl'
@@ -84,13 +87,8 @@ function build_perl {
local perl_sha256=$2
check_var ${perl_sha256}
check_var ${PERL_DOWNLOAD_URL}
curl --connect-timeout 30 \
--max-time 10 \
--retry 5 \
--retry-delay 10 \
--retry-max-time 30 \
-fsSLO ${PERL_DOWNLOAD_URL}/${perl_fname}.tar.gz
fetch_source "${perl_fname}.tar.gz" "${PERL_DOWNLOAD_URL}"
check_sha256sum ${perl_fname}.tar.gz ${perl_sha256}
tar -xzf ${perl_fname}.tar.gz --no-same-owner
(cd ${perl_fname} && do_perl_build)
@@ -109,13 +107,8 @@ function build_openssl {
local openssl_sha256=$2
check_var ${openssl_sha256}
check_var ${OPENSSL_DOWNLOAD_URL}
curl --connect-timeout 30 \
--max-time 10 \
--retry 5 \
--retry-delay 10 \
--retry-max-time 30 \
-fsSLO ${OPENSSL_DOWNLOAD_URL}/${openssl_fname}.tar.gz
fetch_source "${openssl_fname}.tar.gz" "${OPENSSL_DOWNLOAD_URL}"
check_sha256sum ${openssl_fname}.tar.gz ${openssl_sha256}
tar -xzf ${openssl_fname}.tar.gz
(cd ${openssl_fname} && PATH=/opt/perl/bin:${PATH} do_openssl_build)
+3 -3
View File
@@ -24,9 +24,9 @@ has() {
# If OCI_EXE is not already set, search for a container executor (OCI stands for "Open Container Initiative")
if [ -z "$OCI_EXE" ]; then
if which podman >/dev/null 2>/dev/null; then
if type -p podman >/dev/null 2>/dev/null; then
OCI_EXE=podman
elif which docker >/dev/null 2>/dev/null; then
elif type -p docker >/dev/null 2>/dev/null; then
OCI_EXE=docker
else
die "Cannot find a container executor. Search for docker and podman."
@@ -218,7 +218,7 @@ elif [ -n "$CYGWIN" ]; then
HOST_PWD="$( cygpath -w "$( readlink -f "$( pwd ;)" ; )" ; )" ;
else
HOST_PWD=$PWD
[ -L $HOST_PWD ] && HOST_PWD=$(readlink $HOST_PWD)
[ -L "$HOST_PWD" ] && HOST_PWD=$(readlink $HOST_PWD)
fi
# Mount Additional Volumes
+5 -5
View File
@@ -28,12 +28,10 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then
useradd -o -m -g "$BUILDER_GID" -u "$BUILDER_UID" "$BUILDER_USER" 2> /dev/null
# Change ownership of /dev/pts/0 to new user
chown "$BUILDER_UID" /dev/pts/0
chown "$BUILDER_UID" /dev/pts/0 2> /dev/null
export HOME=/home/${BUILDER_USER}
shopt -s dotglob
# Move rustup/cargo directories as they are large, and not needed as root
mv -t $HOME/ /root/.rustup /root/.cargo
# Copy the rest
cp -r /root/* $HOME/
chown -R $BUILDER_UID:$BUILDER_GID $HOME
@@ -52,8 +50,10 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then
gosu $BUILDER_UID:$BUILDER_GID /work/.dockcross
fi
# Run the command as the specified user/group.
exec gosu $BUILDER_UID:$BUILDER_GID "$@"
# Run the command as the specified user. The group will be BUILDER_GID,
# as pulled from /etc/passwd, but will have additional groups from
# /etc/group. This is necessary for manylinux to install python packages.
exec gosu $BUILDER_UID "$@"
else
# Just run the command as root.
exec "$@"
+11 -14
View File
@@ -3,6 +3,12 @@
set -ex
set -o pipefail
# Get script directory
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
# Get build utilities
source $SCRIPT_DIR/utils.sh
ARCH="x86_64"
while [ $# -gt 0 ]; do
@@ -18,11 +24,6 @@ while [ $# -gt 0 ]; do
shift
done
if ! command -v curl &> /dev/null; then
echo >&2 'error: "curl" not found!'
exit 1
fi
if ! command -v tar &> /dev/null; then
echo >&2 'error: "tar" not found!'
exit 1
@@ -35,16 +36,12 @@ fi
cd /usr/src
CMAKE_ROOT=cmake-${CMAKE_VERSION}-Centos5-${ARCH}
url=https://github.com/dockbuild/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_ROOT}.tar.gz
echo "Downloading $url"
curl --connect-timeout 30 \
--max-time 10 \
--retry 5 \
--retry-delay 10 \
--retry-max-time 30 \
-# -LO $url
CMAKE_ROOT=cmake-${CMAKE_VERSION}-linux-${ARCH}
CMAKE_DOWNLOAD_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}
echo "Downloading ${CMAKE_DOWNLOAD_URL}/${CMAKE_ROOT}.tar.gz"
fetch_source "${CMAKE_ROOT}.tar.gz" "${CMAKE_DOWNLOAD_URL}"
tar -xzvf "${CMAKE_ROOT}.tar.gz"
rm -f "${CMAKE_ROOT}.tar.gz"
+16 -3
View File
@@ -56,9 +56,22 @@ url_key="https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$
# download and verify the signature
export GNUPGHOME="$(mktemp -d)"
gpg --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \
gpg --keyserver hkp://pgp.key-server.io:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
GOSU_GPG_KEY=B42F6819007F00F88E364FD4036A9C25BF357DD4
gpg --keyserver hkps://keys.openpgp.org --recv-keys "$GOSU_GPG_KEY" || \
gpg --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys "$GOSU_GPG_KEY" || \
gpg --keyserver hkp://pgp.key-server.io:80 --recv-keys "$GOSU_GPG_KEY" || \
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys "$GOSU_GPG_KEY" || \
{
echo "gpg keyserver lookups failed, falling back to fetching the key over HTTPS" >&2
curl --connect-timeout 30 \
--max-time 30 \
--retry 5 \
--retry-delay 10 \
--retry-max-time 60 \
-fSL "https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x${GOSU_GPG_KEY}" \
| gpg --import
}
echo "Downloading $url"
curl --connect-timeout 30 \
+17
View File
@@ -22,3 +22,20 @@ function check_sha256sum {
rm -f ${fname}.sha256
}
function fetch_source {
if ! command -v curl &> /dev/null; then
echo >&2 'error: "curl" not found!'
exit 1
fi
local file=$1
check_var "${file}"
local url=$2
check_var "${url}"
curl --fail \
--location \
--silent \
--show-error \
--connect-timeout 30 --max-time 10 \
--retry 5 --retry-delay 10 --retry-max-time 30 \
-o "${file}" ${url}/${file}
}
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Mount the PWD and the /work mount dir to enable access in try_run commands
exec ${WASMTIME_HOME}/bin/wasmtime run -W threads=y -S threads=y,cli=y --dir=. --dir=$PWD --dir=/work/ "$@"
exec ${WASMTIME_HOME}/bin/wasmtime run -W threads=y,shared-memory=y -S threads=y,cli=y --dir=. --dir=$PWD --dir=/work/ "$@"
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-arm64-full
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl C SQLite fmt cpython
STOCKFISH_ARGS = ARCH=armv8
OPENSSL_ARGS = linux-aarch64
CPYTHON_ARGS = --host=aarch64-buildroot-linux-gnu --target=aarch64-buildroot-linux-gnu
+3 -3
View File
@@ -836,9 +836,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-arm64-lts
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl C SQLite fmt cpython
STOCKFISH_ARGS = ARCH=armv8
OPENSSL_ARGS = linux-aarch64
CPYTHON_ARGS = --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-arm64-musl
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl C SQLite fmt cpython
STOCKFISH_ARGS = ARCH=armv8
OPENSSL_ARGS = linux-aarch64
CPYTHON_ARGS = --host=aarch64-linux-musl --target=aarch64-linux-musl
+18
View File
@@ -0,0 +1,18 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-arm64
TEST_IMAGE_CMD =
TEST_IMAGE_ARGS =
RUN_IMAGE_CMD =
RUN_IMAGE_ARGS =
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja C SQLite llama_cpp fmt cpython
STOCKFISH_ARGS = ARCH=armv8
CPYTHON_ARGS = --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu
+3 -3
View File
@@ -858,9 +858,9 @@ CT_ZLIB_PATCH_GLOBAL=y
# CT_ZLIB_PATCH_LOCAL_BUNDLED is not set
# CT_ZLIB_PATCH_NONE is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv5-musl
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl SQLite fmt cpython
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=armv5-unknown-linux-musleabi --target=armv5-unknown-linux-musleabi
+3 -3
View File
@@ -800,9 +800,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv5-uclibc
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl SQLite fmt cpython
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=arm-unknown-linux-uclibcgnueabi --target=arm-unknown-linux-uclibcgnueabi
+3 -3
View File
@@ -850,9 +850,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv5
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl SQLite fmt cpython
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=armv5-unknown-linux-gnueabi --target=armv5-unknown-linux-gnueabi
+3 -3
View File
@@ -850,9 +850,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv6-lts
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl SQLite fmt cpython
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=armv6-unknown-linux-gnueabihf --target=armv6-unknown-linux-gnueabihf
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv6-musl
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl SQLite fmt cpython
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=armv6-linux-musleabihf --target=armv6-linux-musleabihf
+3 -3
View File
@@ -852,9 +852,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv6
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl SQLite fmt cpython
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=armv6-unknown-linux-gnueabihf --target=armv6-unknown-linux-gnueabihf
+3 -3
View File
@@ -837,9 +837,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv7-lts
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl SQLite fmt cpython
STOCKFISH_ARGS = ARCH=armv7
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=armv7-unknown-linux-gnueabi --target=armv7-unknown-linux-gnueabi
+3 -3
View File
@@ -852,9 +852,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv7
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl SQLite fmt cpython
STOCKFISH_ARGS = ARCH=armv7
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=armv7-unknown-linux-gnueabi --target=armv7-unknown-linux-gnueabi
+3 -3
View File
@@ -849,9 +849,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv7a-lts
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl SQLite fmt cpython
STOCKFISH_ARGS = ARCH=armv7-neon
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=arm-cortexa8_neon-linux-gnueabihf --target=arm-cortexa8_neon-linux-gnueabihf
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv7a
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl SQLite fmt cpython
STOCKFISH_ARGS = ARCH=armv7-neon
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=arm-cortexa8_neon-linux-gnueabihf --target=arm-cortexa8_neon-linux-gnueabihf
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-armv7l-musl
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl SQLite fmt cpython
STOCKFISH_ARGS = ARCH=armv7
OPENSSL_ARGS = linux-armv4
CPYTHON_ARGS = --host=armv7l-linux-musleabihf --target=armv7l-linux-musleabihf
+3 -3
View File
@@ -766,9 +766,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-i686
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl C SQLite fmt cpython
OPENSSL_ARGS = linux-generic32
CPYTHON_ARGS = --host=i686-linux-gnu --target=i686-linux-gnu
+43
View File
@@ -0,0 +1,43 @@
ARG ORG=dockcross
FROM ${ORG}/base:latest
LABEL maintainer="Gleb Popov arrowd@FreeBSD.org"
# Crosstool-ng version 2025-09-07
ENV CT_VERSION=crosstool-ng-1.28.0
#include "common.crosstool"
# The cross-compiling emulator
RUN apt-get update \
&& apt-get install -y \
qemu-user \
qemu-user-static \
&& apt-get clean --yes
# The CROSS_TRIPLE is a configured alias of the "loongarch64-unknown-linux-gnu" target.
ENV CROSS_TRIPLE=loongarch64-unknown-linux-gnu
ENV CROSS_ROOT=${XCC_PREFIX}/${CROSS_TRIPLE}
ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \
AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \
CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \
CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \
CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \
LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld \
FC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gfortran
ENV QEMU_LD_PREFIX="${CROSS_ROOT}/${CROSS_TRIPLE}/sysroot"
ENV QEMU_SET_ENV="LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${QEMU_LD_PREFIX}"
COPY Toolchain.cmake /usr/lib/${CROSS_TRIPLE}/
ENV CMAKE_TOOLCHAIN_FILE=/usr/lib/${CROSS_TRIPLE}/Toolchain.cmake
ENV PKG_CONFIG_PATH=/usr/lib/loongarch64-unknown-linux-gnu/pkgconfig
# Linux kernel cross compilation variables
ENV PATH=${PATH}:${CROSS_ROOT}/bin
ENV CROSS_COMPILE=${CROSS_TRIPLE}-
ENV ARCH=loongarch64
#include "common.label-and-env"
+20
View File
@@ -0,0 +1,20 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR loongarch64)
set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX})
set(CMAKE_Fortran_COMPILER $ENV{FC})
set(CMAKE_CXX_FLAGS "-I ${cross_root}/include/")
list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_PREFIX_PATH} ${cross_root} ${cross_root}/${cross_triple})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_SYSROOT ${cross_root}/${cross_triple}/sysroot)
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-loongarch64)
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-loongarch64
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl C fmt cpython
STOCKFISH_ARGS = ARCH=loongarch64
OPENSSL_ARGS = linux64-loongarch64
C_ARGS = -DCMAKE_C_FLAGS=-Wno-incompatible-pointer-types
CPYTHON_ARGS = --host=loongarch64-unknown-linux-gnu --target=loongarch64-unknown-linux-gnu
+3 -3
View File
@@ -768,9 +768,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+11
View File
@@ -0,0 +1,11 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-m68k-uclibc
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = SQLite
+3 -3
View File
@@ -851,9 +851,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-mips-lts
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl C SQLite fmt cpython
OPENSSL_ARGS = linux-generic32
CPYTHON_ARGS = --host=mips-unknown-linux-gnu --target=mips-unknown-linux-gnu
+2 -1
View File
@@ -1,4 +1,5 @@
FROM dockcross/base:latest
ARG ORG=dockcross
FROM ${ORG}/base:latest
LABEL maintainer="Rene Helmke rene.helmke@fkie.fraunhofer.de"
+3 -3
View File
@@ -793,9 +793,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-mips-uclibc
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl SQLite fmt cpython
OPENSSL_ARGS = linux-generic32
CPYTHON_ARGS = --host=mips-unknown-linux-uclibc --target=mips-unknown-linux-uclibc
+3 -3
View File
@@ -838,9 +838,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-mips
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl C SQLite fmt cpython
OPENSSL_ARGS = linux-generic32
CPYTHON_ARGS = --host=mips-unknown-linux-gnu --target=mips-unknown-linux-gnu
+3 -3
View File
@@ -818,9 +818,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+11
View File
@@ -0,0 +1,11 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-mipsel-lts
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = SQLite fmt
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-ppc
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl C SQLite llama_cpp fmt cpython
OPENSSL_ARGS = linux-ppc
CPYTHON_ARGS = --host=powerpc-unknown-linux-gnu --target=powerpc-unknown-linux-gnu
+3 -3
View File
@@ -841,9 +841,9 @@ CT_ZLIB_DEVEL_REVISION=""
CT_ZLIB_DEVEL_SUBDIR=""
CT_ZLIB_DEVEL_BOOTSTRAP=""
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-ppc64le-lts
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl C SQLite fmt cpython
STOCKFISH_ARGS = ARCH=ppc-64
OPENSSL_ARGS = linux-ppc64le
CPYTHON_ARGS = --host=powerpc64le-unknown-linux-gnu --target=powerpc64le-unknown-linux-gnu
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-ppc64le
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl C SQLite llama_cpp fmt cpython
STOCKFISH_ARGS = ARCH=ppc-64
OPENSSL_ARGS = linux-ppc64le
CPYTHON_ARGS = --host=powerpc64le-unknown-linux-gnu --target=powerpc64le-unknown-linux-gnu
+3 -3
View File
@@ -919,9 +919,9 @@ CT_ZLIB_PATCH_GLOBAL=y
# CT_ZLIB_PATCH_LOCAL_BUNDLED is not set
# CT_ZLIB_PATCH_NONE is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-riscv32
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl SQLite fmt cpython
OPENSSL_ARGS = linux-generic32
CPYTHON_ARGS = --host=riscv32-unknown-linux-gnu --target=riscv32-unknown-linux-gnu
+3 -3
View File
@@ -919,9 +919,9 @@ CT_ZLIB_PATCH_GLOBAL=y
# CT_ZLIB_PATCH_LOCAL_BUNDLED is not set
# CT_ZLIB_PATCH_NONE is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-riscv64
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl SQLite fmt cpython
OPENSSL_ARGS = linux-generic64
CPYTHON_ARGS = --host=riscv64-unknown-linux-gnu --target=riscv64-unknown-linux-gnu
+3 -3
View File
@@ -804,9 +804,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-s390x
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl C SQLite fmt cpython
OPENSSL_ARGS = linux64-s390x
CPYTHON_ARGS = --host=s390x-ibm-linux-gnu --target=s390x-ibm-linux-gnu
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-x64-clang
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl C SQLite fmt cpython
STOCKFISH_ARGS = ARCH=x86-64-modern COMP=clang
OPENSSL_ARGS = linux-x86_64-clang
+15
View File
@@ -0,0 +1,15 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-x64-tinycc
TEST_IMAGE_ARGS = --languages C
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl fmt
STOCKFISH_ARGS = ARCH=x86-64-modern
OPENSSL_ARGS = linux-generic64 no-tests no-asm no-hw no-dtls no-shared no-dso
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-x64
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl C SQLite fmt cpython
STOCKFISH_ARGS = ARCH=x86-64-modern
OPENSSL_ARGS = linux-x86_64
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-x86
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl C SQLite fmt cpython
STOCKFISH_ARGS = ARCH=x86-32-sse41-popcnt
OPENSSL_ARGS = linux-x86
+14
View File
@@ -0,0 +1,14 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-x86_64-full
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = stockfish ninja openssl C SQLite fmt cpython
STOCKFISH_ARGS = ARCH=x86-64-modern
OPENSSL_ARGS = linux-x86_64
CPYTHON_ARGS = --host=x86_64-buildroot-linux-gnu --target=x86_64-buildroot-linux-gnu
+3 -3
View File
@@ -733,9 +733,9 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_VERSION="1.2.12"
CT_ZLIB_MIRRORS="http://downloads.sourceforge.net/project/libpng/zlib/${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/"
CT_ZLIB_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
CT_ZLIB_ARCHIVE_FORMATS=".tar.xz .tar.gz"
+13
View File
@@ -0,0 +1,13 @@
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?= dockcross
BASE_IMAGE_NAME = base
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = linux-xtensa-uclibc
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = ninja openssl cpython
OPENSSL_ARGS = linux-generic64 no-asm no-threads no-engine no-hw no-weak-ssl-ciphers no-dtls no-shared no-dso
CPYTHON_ARGS = --host=xtensa-fsf-linux-uclibc --target=xtensa-fsf-linux-uclibc
@@ -4,3 +4,41 @@ for PIP in /opt/python/*/bin/pip; do
$PIP install --disable-pip-version-check --upgrade pip
$PIP install scikit-build==0.8.1
done
# pip is installing everything as root. We need to make sure whatever uid/gid
# is used when the image is run is able to update the python install. We don't
# want to limit which uid/gid can be used, so instead we're going to:
# - create a custom group
# - change the group of the python directories to the new group
# - change the permissions of the python directories to allow the group to write
# This GID isn't used in the manylinux image, but just to be safe, we'll verify
# it's still not in use during the image build.
BUILDER_GID=200
if id -g "$BUILDER_GID" 2> /dev/null; then
echo "Error: builder gid $BUILDER_GID already exists! Aborting"
exit 1
fi
# Add the builder group
groupadd -g $BUILDER_GID builder
# Update the permissions for all python directories so they're owned by the
# builder group, and the builder group can write to them.
for DIR in /opt/python/*/lib/python*/site-packages; do
chown -R :$BUILDER_GID $DIR
chmod g+w $DIR
done
for DIR in /opt/python/*/bin; do
chown -R :$BUILDER_GID $DIR
chmod g+w $DIR
done
for DIR in /opt/python/*; do
mkdir $DIR/man
chown -R :$BUILDER_GID $DIR/man
chmod g+w $DIR/man
done
for DIR in /opt/python/*/share; do
chown -R :$BUILDER_GID $DIR
chmod g+w $DIR
done
+3 -13
View File
@@ -1,15 +1,5 @@
#!/usr/bin/env bash
for DIR in /opt/python/*/lib/python*/site-packages; do
chown -R $BUILDER_UID:$BUILDER_GID $DIR
done
for DIR in /opt/python/*/bin; do
chown -R $BUILDER_UID:$BUILDER_GID $DIR
done
for DIR in /opt/python/*; do
mkdir $DIR/man
chown -R $BUILDER_UID:$BUILDER_GID $DIR/man
done
for DIR in /opt/python/*/share; do
chown -R $BUILDER_UID:$BUILDER_GID $DIR
done
# Add the BUILDER_USER to the builder group so `pip install` doesn't get access
# denied errors.
usermod -a -G builder $BUILDER_USER
+2 -3
View File
@@ -29,9 +29,8 @@ ENV PATH=${PATH}:${CROSS_ROOT}/bin
# Running scripts to cross compile python and copy libstdc++ into toolcain
ADD manylinux2014-aarch64/xc_script /tmp/
RUN PASS=2 /tmp/docker_setup_scrpits/copy_libstd.sh
RUN /tmp/docker_setup_scrpits/prepare_cross_env.sh
RUN rm -rf /tmp/docker_setup_scrpits
RUN /tmp/docker_setup_scripts/prepare_cross_env.sh
RUN rm -rf /tmp/docker_setup_scripts
RUN rm -rf /tmp/usr/
ENV AS=${CROSS_TRIPLE}-as \
+1 -1
View File
@@ -806,7 +806,7 @@ CT_ZLIB_PKG_NAME="zlib"
CT_ZLIB_SRC_RELEASE=y
# CT_ZLIB_SRC_DEVEL is not set
CT_ZLIB_PATCH_ORDER="global"
CT_ZLIB_V_1_2_12=y
CT_ZLIB_V_1_2_13=y
CT_ZLIB_VERSION="1.2.13"
CT_ZLIB_MIRRORS="https://github.com/madler/zlib/releases/download/v${CT_ZLIB_VERSION} https://www.zlib.net/ https://www.zlib.net/fossils"
+25
View File
@@ -0,0 +1,25 @@
# manylinux2014-aarch64 is FROM ${ORG}/manylinux2014-x64:latest (cross toolchain
# layered on top of the x64 manylinux image, so it can run on an x86_64 host).
BASE_IMAGE_REGISTRY ?= docker.io
BASE_IMAGE_PATH ?=
BASE_IMAGE_NAME = manylinux2014-x64
BASE_IMAGE_TAG = latest
OUTPUT_IMAGE_REGISTRY ?= docker.io
OUTPUT_IMAGE_PATH ?= dockcross
OUTPUT_IMAGE_NAME = manylinux2014-aarch64
# Dockerfile.in ADDs manylinux2014-aarch64/xc_script and COPYs
# manylinux2014-aarch64/Toolchain.cmake, so the build context has to be the
# repository root, not this preset's own directory.
BUILD_CONTEXT_DIR = $(PRESET_DIR)
DEPENDS_ON = manylinux2014-x64.build
TEST_IMAGE_CMD = /opt/python/cp311-cp311/bin/python test/run.py
TEST_IMAGE_ARGS =
# Extra tests (see CONTRIBUTING.md / Makefile "Extra tests" section)
EXTRA_TESTS = openssl SQLite cpython
OPENSSL_ARGS = linux-aarch64
CPYTHON_ARGS = --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu

Some files were not shown because too many files have changed in this diff Show More