Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zackees/docker-run-cmd
Uses docker to run a command that's been dockerized, supports volume mounts
https://github.com/zackees/docker-run-cmd
Last synced: about 1 month ago
JSON representation
Uses docker to run a command that's been dockerized, supports volume mounts
- Host: GitHub
- URL: https://github.com/zackees/docker-run-cmd
- Owner: zackees
- License: mit
- Created: 2024-02-19T00:12:47.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-03-25T08:21:00.000Z (10 months ago)
- Last Synced: 2024-04-26T15:01:49.948Z (8 months ago)
- Language: Python
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-run-cmd
```bash
pip install run-docker-cmd
```Run a self contained docker file representing an entry point. Useful for dockerizing
utility functions.[![Linting](../../actions/workflows/lint.yml/badge.svg)](../../actions/workflows/lint.yml)
[![MacOS_Tests](../../actions/workflows/push_macos.yml/badge.svg)](../../actions/workflows/push_macos.yml)
[![Ubuntu_Tests](../../actions/workflows/push_ubuntu.yml/badge.svg)](../../actions/workflows/push_ubuntu.yml)
[![Win_Tests](../../actions/workflows/push_win.yml/badge.svg)](../../actions/workflows/push_win.yml)Example dockerfile command:
```
# Use the official Python 3.10 Alpine-based image
FROM python:3.10-alpine# Install yt-dlp dependencies and yt-dlp itself
# Adding necessary packages including ffmpeg
RUN apk add --no-cache \
ffmpeg \
dos2unix \
&& pip install --no-cache-dir yt-dlp ytdlp-brighteon# Set the working directory in the container
WORKDIR /host_dir# Build the entrypoint script in the container.
RUN echo '#!/bin/sh' > /entrypoint.sh && \
echo 'yt-dlp "$@"' >> /entrypoint.sh# Make the entrypoint script executable
RUN chmod +x /entrypoint.sh# Set the entrypoint to use /bin/sh
ENTRYPOINT ["sh", "/entrypoint.sh"]
```Now save this as mydockerfile
Now run it:
```bash
run-docker-cmd mydockerfile
```## Docker commands
Self contained dockerfile's representing a command to be run. No external dependencies. The current working directory will be mapped into the container as /host_dir
# Develope
To develop software, run `. ./activate.sh`
# Windows
This environment requires you to use `git-bash`.
# Linting
Run `./lint.sh` to find linting errors using `pylint`, `flake8` and `mypy`.