# 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`.
Raw data
{
"_id": null,
"home_page": "https://github.com/zackees/docker-run-cmd",
"name": "docker-run-cmd",
"maintainer": "Zachary Vorhies",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "template-python-cmd",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/b4/f6/12dc5bd86ae81e5bb068995a163591adf8168a77203fd5e102c56259950c/docker-run-cmd-1.0.14.tar.gz",
"platform": null,
"description": "# docker-run-cmd\r\n\r\n```bash\r\npip install run-docker-cmd\r\n```\r\n\r\nRun a self contained docker file representing an entry point. Useful for dockerizing\r\nutility functions.\r\n\r\n[![Linting](../../actions/workflows/lint.yml/badge.svg)](../../actions/workflows/lint.yml)\r\n\r\n[![MacOS_Tests](../../actions/workflows/push_macos.yml/badge.svg)](../../actions/workflows/push_macos.yml)\r\n[![Ubuntu_Tests](../../actions/workflows/push_ubuntu.yml/badge.svg)](../../actions/workflows/push_ubuntu.yml)\r\n[![Win_Tests](../../actions/workflows/push_win.yml/badge.svg)](../../actions/workflows/push_win.yml)\r\n\r\n\r\nExample dockerfile command:\r\n```\r\n# Use the official Python 3.10 Alpine-based image\r\nFROM python:3.10-alpine\r\n\r\n# Install yt-dlp dependencies and yt-dlp itself\r\n# Adding necessary packages including ffmpeg\r\nRUN apk add --no-cache \\\r\n ffmpeg \\\r\n dos2unix \\\r\n && pip install --no-cache-dir yt-dlp ytdlp-brighteon\r\n\r\n# Set the working directory in the container\r\nWORKDIR /host_dir\r\n\r\n# Build the entrypoint script in the container.\r\nRUN echo '#!/bin/sh' > /entrypoint.sh && \\\r\n echo 'yt-dlp \"$@\"' >> /entrypoint.sh\r\n\r\n# Make the entrypoint script executable\r\nRUN chmod +x /entrypoint.sh\r\n\r\n# Set the entrypoint to use /bin/sh\r\nENTRYPOINT [\"sh\", \"/entrypoint.sh\"]\r\n```\r\n\r\nNow save this as mydockerfile\r\n\r\nNow run it:\r\n\r\n```bash\r\nrun-docker-cmd mydockerfile\r\n```\r\n\r\n## Docker commands\r\n\r\nSelf 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\r\n\r\n# Develope\r\n\r\nTo develop software, run `. ./activate.sh`\r\n\r\n# Windows\r\n\r\nThis environment requires you to use `git-bash`.\r\n\r\n# Linting\r\n\r\nRun `./lint.sh` to find linting errors using `pylint`, `flake8` and `mypy`.\r\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "Runs Dockerized commands",
"version": "1.0.14",
"project_urls": {
"Homepage": "https://github.com/zackees/docker-run-cmd"
},
"split_keywords": [
"template-python-cmd"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a14360addb7206c47bd7e6a7f75b2a652fd08035e7fede8c3a7371fad4b1031a",
"md5": "79163ca64cad7add3120c8d7be5599c3",
"sha256": "61a5ce3ceaaf8049e80c59cf7f974e3e7c56c02b57e30a58af0a248df6edc62f"
},
"downloads": -1,
"filename": "docker_run_cmd-1.0.14-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "79163ca64cad7add3120c8d7be5599c3",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 6889,
"upload_time": "2024-03-25T08:21:08",
"upload_time_iso_8601": "2024-03-25T08:21:08.282028Z",
"url": "https://files.pythonhosted.org/packages/a1/43/60addb7206c47bd7e6a7f75b2a652fd08035e7fede8c3a7371fad4b1031a/docker_run_cmd-1.0.14-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b4f612dc5bd86ae81e5bb068995a163591adf8168a77203fd5e102c56259950c",
"md5": "ff8260b11b82a82148b54864cbdd9098",
"sha256": "a6b0730860a4329ad234deaa5389d824320bd92d13695833b4b7214061fae6ef"
},
"downloads": -1,
"filename": "docker-run-cmd-1.0.14.tar.gz",
"has_sig": false,
"md5_digest": "ff8260b11b82a82148b54864cbdd9098",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 14658,
"upload_time": "2024-03-25T08:21:09",
"upload_time_iso_8601": "2024-03-25T08:21:09.805214Z",
"url": "https://files.pythonhosted.org/packages/b4/f6/12dc5bd86ae81e5bb068995a163591adf8168a77203fd5e102c56259950c/docker-run-cmd-1.0.14.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-25 08:21:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zackees",
"github_project": "docker-run-cmd",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "docker-run-cmd"
}