Re:Docker, Django, Traefik, and IntercoolerJS: My go-to stac...
by mike-cardwell on Sunday January 31, 2021 @05:21AM
(#25977709)
I prefer my system for running youtube-dl in an isolated environment without having to install all of its dependencies on the host. Ansible writes a bash script at ~/bin/youtube-dl containing:
#!/usr/bin/env bash
set -e
IMAGE_NAME="grepular/youtube-dl"
# Build the image if it does not exist
if [[ $(podman images --filter "reference=$IMAGE_NAME" -q) == "" ]]; then
podman build -t "$IMAGE_NAME" -<<EOF >&2
FROM python:3-slim
RUN python3 -m pip --no-cache-dir install youtube_dl
ENTRYPOINT ["youtube-dl"]
EOF
fi
podman run --net host -i --rm -v "$PWD:/app" -w /app "$IMAGE_NAME" "$@"
Re:Docker, Django, Traefik, and IntercoolerJS: My go-to stac...
by wp381640 on Sunday January 31, 2021 @11:21AM
(#25979875)
Pipx is pretty much that - installs a package into its own venv and links script entry points to .local/bin
Re:Docker, Django, Traefik, and IntercoolerJS: My go-to stac...
by ORioN63 on Sunday January 31, 2021 @07:21AM
(#25978277)
QQ, aren't the created files owned by root?
Re:Docker, Django, Traefik, and IntercoolerJS: My go-to stac...
by mike-cardwell on Sunday January 31, 2021 @08:42AM
(#25978745)
Nope. I'm using podman rather than docker so they're owned by the user that runs the script. The root user isn't involved. If I were using docker, I'd add `-u "$(id -u):$(id -g)"` to the docker args to deal with that issue.
https://pipxproject.github.io/pipx/