Add dtool
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
f2b45b57e2
commit
d81bd6e56d
3 changed files with 43 additions and 0 deletions
9
.config/dtool/ffmpeg/Dockerfile
Normal file
9
.config/dtool/ffmpeg/Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
FROM alpine:3.8
|
||||||
|
|
||||||
|
ARG UID=1000
|
||||||
|
|
||||||
|
RUN set -ex \
|
||||||
|
&& adduser -u $UID -D work \
|
||||||
|
&& apk add --no-update ffmpeg
|
||||||
|
|
||||||
|
ENTRYPOINT ["ffmpeg"]
|
8
.config/dtool/imagick/Dockerfile
Normal file
8
.config/dtool/imagick/Dockerfile
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
FROM alpine:3.8
|
||||||
|
|
||||||
|
ARG UID=1000
|
||||||
|
|
||||||
|
RUN set -ex \
|
||||||
|
&& adduser -u $UID -D work \
|
||||||
|
&& apk add --no-update imagemagick
|
||||||
|
|
26
bin/dtool
Executable file
26
bin/dtool
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
source ${HOME}/bin/script_framework.sh
|
||||||
|
|
||||||
|
[ $# -lt 1 ] && fail "At least the tool must be specified"
|
||||||
|
|
||||||
|
TOOL=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
toolimage="dtool.local/${TOOL}"
|
||||||
|
|
||||||
|
docker images | grep -q "^${toolimage}" || {
|
||||||
|
step "Building tool image for \"${TOOL}\""
|
||||||
|
toolpath="${HOME}/.config/dtool/${TOOL}"
|
||||||
|
docker build -q \
|
||||||
|
-t "${toolimage}" \
|
||||||
|
--build-arg UID=$(id -u) \
|
||||||
|
"${toolpath}"
|
||||||
|
}
|
||||||
|
|
||||||
|
step "Executing \"${toolimage} $@\"..."
|
||||||
|
exec docker run --rm -ti \
|
||||||
|
-u $(id -u) \
|
||||||
|
-v "$(pwd):$(pwd)" -w "$(pwd)" \
|
||||||
|
"${toolimage}" "$@"
|
Loading…
Reference in a new issue