-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1033: Fix image build errors with podman and nerdctl. r=Emilgardis a=Alexhuszagh Ensures that docker and nerdctl, which support the custom `--output` and `--cache-from` flags use them, while podman and unknown container engines use the strict, minimal subset podman supports. This is because podman only supports a registry/repository, without a tag, for `--cache-from`, which means it synchronizes poorly with our target subs, like `centos`. Therefore, unless unsupported, we should always use the features available for our container engine. This also fixes the `--pull` flag on nerdctl, which is unsupported. Engines without BuildKit extensions by default, such as nerdctl, now do not use `buildx` unless explicitly enabled with `CROSS_CONTAINER_ENGINE_NO_BUILDKIT=0`. Closes #1031. Co-authored-by: Alex Huszagh <[email protected]>
- Loading branch information
Showing
5 changed files
with
123 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"description": "fix --cache-from using podman.", | ||
"type": "fixed", | ||
"issues": [1031] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
# shellcheck disable=SC1091,SC1090 | ||
|
||
# test to see that running and building images with podman works. | ||
|
||
set -x | ||
set -eo pipefail | ||
|
||
export CROSS_CONTAINER_ENGINE=podman | ||
if [[ -z "${TARGET}" ]]; then | ||
export TARGET="aarch64-unknown-linux-gnu" | ||
fi | ||
|
||
ci_dir=$(dirname "${BASH_SOURCE[0]}") | ||
ci_dir=$(realpath "${ci_dir}") | ||
. "${ci_dir}"/shared.sh | ||
|
||
main() { | ||
local td= | ||
local parent= | ||
local target="${TARGET}" | ||
|
||
retry cargo fetch | ||
cargo build | ||
export CROSS="${PROJECT_HOME}/target/debug/cross" | ||
|
||
td="$(mkcargotemp -d)" | ||
parent=$(dirname "${td}") | ||
pushd "${td}" | ||
cargo init --bin --name "hello" . | ||
|
||
echo '[build] | ||
pre-build = ["apt-get update"]' > "${parent}/Cross.toml" | ||
|
||
CROSS_CONTAINER_ENGINE="${CROSS_ENGINE}" "${CROSS}" build --target "${target}" --verbose | ||
|
||
popd | ||
rm -rf "${td}" | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters