-
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.
Reduce number of layers in main container image (#398)
- Loading branch information
Showing
6 changed files
with
102 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
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,39 @@ | ||
#!/bin/bash -e | ||
# cspell: ignore onigurumacffi,makecache,euxo,libssh,overlayfs,setcaps | ||
set -euxo pipefail | ||
|
||
microdnf -q -y makecache | ||
microdnf -q -y update | ||
microdnf -q -y install shadow-utils | ||
rpm --setcaps shadow-utils 2>/dev/null | ||
|
||
microdnf remove -y subscription-manager dnf-plugin-subscription-manager | ||
microdnf install -q -y \ | ||
tar \ | ||
echo \ | ||
podman \ | ||
fuse-overlayfs \ | ||
openssh-clients \ | ||
zsh \ | ||
util-linux-user \ | ||
which \ | ||
git \ | ||
nano \ | ||
vim \ | ||
dumb-init \ | ||
gcc \ | ||
git-core \ | ||
libssh-devel \ | ||
python3-markupsafe \ | ||
ncurses \ | ||
oniguruma-devel \ | ||
python3-bcrypt \ | ||
python3-cffi \ | ||
python3-devel \ | ||
python3-pip \ | ||
python3-pyyaml \ | ||
python3-ruamel-yaml \ | ||
python3-wheel \ | ||
--exclude container-selinux \ | ||
&& microdnf -q clean all \ | ||
&& ln -s /usr/bin/vim /usr/bin/vi |
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,42 @@ | ||
#!/bin/bash -e | ||
# cspell: ignore onigurumacffi,makecache,euxo,libssh,overlayfs,setcaps | ||
set -euxo pipefail | ||
|
||
microdnf -q -y makecache && microdnf -q -y update | ||
microdnf -q -y install shadow-utils | ||
rpm --setcaps shadow-utils 2>/dev/null | ||
|
||
microdnf remove -y subscription-manager dnf-plugin-subscription-manager | ||
|
||
# gcc: for ansible-pylibssh, onigurumacffi/arm64 | ||
# ncurses: for ansible-navigator | ||
# oniguruma-devel: onigurumacffi/arm64 (does not have binary) | ||
microdnf install -q -y \ | ||
tar \ | ||
echo \ | ||
podman \ | ||
fuse-overlayfs \ | ||
openssh-clients \ | ||
zsh \ | ||
util-linux-user \ | ||
which \ | ||
git \ | ||
nano \ | ||
vim \ | ||
dumb-init \ | ||
gcc \ | ||
git-core \ | ||
libssh-devel \ | ||
python3-markupsafe \ | ||
ncurses \ | ||
oniguruma-devel \ | ||
python3-bcrypt \ | ||
python3-cffi \ | ||
python3-devel \ | ||
python3-pip \ | ||
python3-pyyaml \ | ||
python3-ruamel-yaml \ | ||
python3-wheel \ | ||
--exclude container-selinux \ | ||
&& microdnf -q clean all \ | ||
&& ln -s /usr/bin/vim /usr/bin/vi |
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,15 @@ | ||
#!/bin/bash -e | ||
# cspell: ignore exuo,outdir | ||
set -exuo pipefail | ||
|
||
REPO_DIR=$(git rev-parse --show-toplevel) | ||
|
||
|
||
# BUILD_CMD="podman build --squash-all" | ||
BUILD_CMD="docker build --progress=plain" | ||
|
||
python -m build --outdir $REPO_DIR/final/dist/ --wheel $REPO_DIR | ||
ansible-builder create -f execution-environment.yml --output-filename Containerfile -v3 | ||
$BUILD_CMD -f context/Containerfile context/ --tag community-ansible-dev-tools-base:latest | ||
$BUILD_CMD -f final/Containerfile final/ --tag community-ansible-dev-tools:test | ||
pytest --only-container --image-name community-ansible-dev-tools:test |
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