From 4f1e914a18cce6e4257f1943c915d8a1aa94e9d8 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Mon, 22 Aug 2022 12:22:21 +0200 Subject: [PATCH] doc(README): usage --- Dockerfile | 2 +- README.md | 43 ++++++++++++++++++++++++++----------------- mkisofs.sh | 20 -------------------- 3 files changed, 27 insertions(+), 38 deletions(-) delete mode 100755 mkisofs.sh diff --git a/Dockerfile b/Dockerfile index cf25037..bd9ad64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,4 @@ RUN if [ -z ${MKISOFS_VERSION+x} ]; then \ yum install --assumeyes xorriso-${MKISOFS_VERSION}; \ fi -ENTRYPOINT [ "/usr/bin/xorriso" ] +ENTRYPOINT [ "/usr/bin/mkisofs" ] diff --git a/README.md b/README.md index 03faf66..0354cdd 100644 --- a/README.md +++ b/README.md @@ -10,22 +10,31 @@ The primary goal of this project is to package the binary `mkisofs` and dependencies as container image to provide the functionally for CI/CD workflows or for systems which does contains the binary. -## mkisofs.sh - -The shell script `mkisofs.sh` is a wrapper for the binary `mkisofs`, which -is not available depending on the distribution. It starts the container image -`docker.io/volkerraschek/mkisofs` in the background to call the binary. For -this reason, a container runtime like `docker` or `podman` is necessary. - -### Installation - -The script can be installed via the following command: - -```bash -curl https://git.cryptic.systems/volker.raschek/mkisofs-docker/raw/branch/master/mkisofs.sh --output - | sudo tee /usr/local/bin/mkisofs.sh && sudo chmod +x /usr/local/bin/mkisofs.sh -``` - -### Usage +## Usage The script forwards all arguments directly to the binary running inside the -container. For this reason, all arguments from the original binary can be used. +container. For this reason, all arguments from the original binary can be used, +for example to create an adapted bootable fedora iso image. + +```bash +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +podman run \ + --rm \ + --volume ${SCRIPT_DIR}:/workspace \ + --workdir /workspace \ + docker.io/volkerraschek/mkisofs \ + -output /workspace/fedora-35.iso \ + -eltorito-boot isolinux/isolinux.bin \ + -eltorito-catalog isolinux/boot.cat \ + -no-emul-boot \ + -joliet \ + -joliet-long \ + -boot-load-size 4 \ + -boot-info-table \ + -full-iso9660-filenames \ + -rational-rock \ + -verbose \ + -volid "exam" \ # specified in ks.cfg + /workspace/custom-iso +``` diff --git a/mkisofs.sh b/mkisofs.sh deleted file mode 100755 index 55b40d3..0000000 --- a/mkisofs.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -e - -CONTAINER_RUNTIME=$(which podman) - -MKISOFS_IMAGE_FULLY_QUALIFIED=docker.io/volkerraschek/mkisofs:latest - -CUSTOM_UID=$(getent passwd ${USER} | cut -d ':' -f 3) -CUSTOM_GID=$(getent passwd ${USER} | cut -d ':' -f 4) - -# Extract last element of passed arguments -REPO_DIR=${@: -1} - -${CONTAINER_RUNTIME} run \ - --rm \ - --volume ${REPO_DIR}:${REPO_DIR} \ - --workdir ${REPO_DIR} \ - --user ${CUSTOM_UID}:${CUSTOM_GID} \ - ${MKISOFS_IMAGE_FULLY_QUALIFIED} ${@}