-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor devspaces image build to produce smaller image
# Conflicts: # .github/workflows/tox.yml # devspaces/context/setup.sh # tox.ini
- Loading branch information
Showing
8 changed files
with
79 additions
and
46 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 |
---|---|---|
|
@@ -16,6 +16,7 @@ containerfile | |
devcontainer | ||
devel | ||
devfile | ||
devspaces | ||
endgroup | ||
gunicorn | ||
libera | ||
|
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 |
---|---|---|
|
@@ -177,3 +177,4 @@ _readthedocs | |
# ansible-builder | ||
/context | ||
/collections | ||
out |
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
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,23 @@ | ||
#!/bin/bash -e | ||
# cspell: ignore euxo buildx | ||
set -euxo pipefail | ||
ADT_CONTAINER_ENGINE=${ADT_CONTAINER_ENGINE:-docker} | ||
CONTAINER_NAME=ansible/ansible-workspace-env-reference:test | ||
env | ||
|
||
mkdir -p out | ||
# we force use of linux/amd64 platform because source image supports only this | ||
# platform and without it, it will fail to cross-build when task runs on arm64. | ||
# --metadata-file=out/devspaces.meta --no-cache | ||
$ADT_CONTAINER_ENGINE buildx build --tag=$CONTAINER_NAME --platform=linux/amd64 devspaces/context -f devspaces/Containerfile | ||
|
||
mk containers check $CONTAINER_NAME --engine="${ADT_CONTAINER_ENGINE}" --max-size=1600 --max-layers=23 | ||
|
||
if [[ -n "${GITHUB_SHA:-}" ]]; then | ||
$ADT_CONTAINER_ENGINE tag $CONTAINER_NAME "ghcr.io/ansible/ansible-devspaces-tmp:${GITHUB_SHA}" | ||
# https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry | ||
if [[ -n "${GITHUB_TOKEN:-}" ]]; then | ||
echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$GITHUB_ACTOR" --password-stdin | ||
fi | ||
$ADT_CONTAINER_ENGINE push "ghcr.io/ansible/ansible-devspaces-tmp:${GITHUB_SHA}" | ||
fi |
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