Skip to content

Commit

Permalink
Merge pull request #1 from ika-rwth-aachen/improvement/usability
Browse files Browse the repository at this point in the history
Improve usability
  • Loading branch information
lreiher authored Jun 10, 2023
2 parents ced6f64 + b8186e4 commit 20666c4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ pip install docker-run-cli
source $(activate-python-docker-run-shell-completion 2> /dev/null)
```

> **Warning**
> Outside of a virtual environment, *pip* may default to a user-site installation of executables to `~/.local/bin`, which may not be present in your shell's `PATH`. If running `docker-run` errors with `docker-run: command not found`, add the directory to your path. [*(More information)*](https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-to-the-user-site)
> ```bash
> echo "export PATH=$HOME/.local/bin:$PATH" >> ~/.bashrc
> source ~/.bashrc
> ```
## Usage
Expand Down
2 changes: 1 addition & 1 deletion docker-run/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "docker-run-cli"
version = "0.9.1"
version = "0.9.2"
description = "'docker run' and 'docker exec' with useful defaults"
license = {file = "LICENSE"}
readme = "README.md"
Expand Down
5 changes: 2 additions & 3 deletions docker-run/scripts/docker-run
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ if [[ $OS != "Darwin" ]]; then
echo "User '${USER}' must be in 'docker' group to run containers."
echo "User can be added via: sudo usermod -aG docker ${USER}"
echo "Afterwards, the user may need to logout and login again."
exit 1
fi
fi

# check operating system and architecture
if ! { [[ $OS = "Linux" && $ARCH = "x86_64" ]] || [[ $OS = "Darwin" && $ARCH = "arm64" ]] || [[ $OS = "Linux" && $ARCH = "aarch64" ]]; }; then
>&2 echo "This script does not support $OS with $ARCH architecture."
>&2 echo "docker-run does not support $OS with $ARCH architecture."
exit 1
fi

# generate docker run/exec command
CMD_FILE=$(mktemp)
python -m docker_run "${@}" 2>&1 >$CMD_FILE
python3 -m docker_run "${@}" 2>&1 >$CMD_FILE
CMD=$(cat $CMD_FILE)
rm $CMD_FILE

Expand Down
2 changes: 1 addition & 1 deletion docker-run/src/docker_run/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__name__ = "docker-run"
__version__ = "0.9.1"
__version__ = "0.9.2"

0 comments on commit 20666c4

Please sign in to comment.