mirror of
https://github.com/bitnami/minideb.git
synced 2026-06-04 10:13:55 +08:00
Optional build with Podman (#206)
* Fix for podman usage The output of load command in docker and podman differs: - docker produces only one line of output the sha256 hash at 4th position - podman produces mulktiple lines of output with sha256 hash in the last line at third position This patch filters the line with hash and print the last argument, which is the hash. It works with docker and podman. Signed-off-by: flymarq <github@flynnux.de> * Add hints for building with podman Provide a simple command toi replace all relevant calls to docker with podman to enable a daemon less run. Signed-off-by: flymarq <github@flynnux.de> --------- Signed-off-by: flymarq <github@flynnux.de>
This commit is contained in:
@@ -80,6 +80,11 @@ To test the resulting image:
|
|||||||
$ sudo make test-trixie
|
$ sudo make test-trixie
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Building the image with podman instead of docker is possible, if you replace docker with podman in 4 scripts:
|
||||||
|
```
|
||||||
|
$ sed -i "s/docker /podman /g" buildone dockerdiff import test
|
||||||
|
```
|
||||||
|
|
||||||
## Building Minideb for foreign architecture
|
## Building Minideb for foreign architecture
|
||||||
Make commands shown above will build an image for the architecture you are currently working on.
|
Make commands shown above will build an image for the architecture you are currently working on.
|
||||||
To build an image for a foreign architecture (for example to build a multi-arch image), we provide a
|
To build an image for a foreign architecture (for example to build a multi-arch image), we provide a
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import() {
|
|||||||
local MANIFEST="$(echo -n "$MANIFEST_TEMPLATE" | sed -e "s/%CONF_SHA%/$CONF_SHA/g" -e "s/%LAYERSUM%/$LAYERSUM/g")"
|
local MANIFEST="$(echo -n "$MANIFEST_TEMPLATE" | sed -e "s/%CONF_SHA%/$CONF_SHA/g" -e "s/%LAYERSUM%/$LAYERSUM/g")"
|
||||||
echo -n "$MANIFEST" > $TDIR/manifest.json
|
echo -n "$MANIFEST" > $TDIR/manifest.json
|
||||||
tar cf $TDIR/import.tar -C $TDIR manifest.json "${CONF_SHA}.json" "$LAYERSUM"
|
tar cf $TDIR/import.tar -C $TDIR manifest.json "${CONF_SHA}.json" "$LAYERSUM"
|
||||||
local ID=$(docker load -i $TDIR/import.tar | awk '{print $4}')
|
local ID=$(docker load -i $TDIR/import.tar | grep Loaded\ image | awk '{print $NF}')
|
||||||
if [ "$ID" != "sha256:$CONF_SHA" ]; then
|
if [ "$ID" != "sha256:$CONF_SHA" ]; then
|
||||||
echo "Failed to load $ID correctly, expected id to be $CONF_SHA, source in $TDIR" >&2
|
echo "Failed to load $ID correctly, expected id to be $CONF_SHA, source in $TDIR" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user