Skip to content

Instantly share code, notes, and snippets.

@alanplatt
Created February 13, 2023 15:45
Show Gist options
  • Save alanplatt/93db87434fd6c83aea9e363d1f46d3fe to your computer and use it in GitHub Desktop.
Save alanplatt/93db87434fd6c83aea9e363d1f46d3fe to your computer and use it in GitHub Desktop.
Run commands from a container.
# Mount the current directory as the working directory in the contianer (great for linting etc)
alias docker-run='docker run -it --workdir ${PWD} -v ${PWD}:${PWD}'
# Generate a Dockerfile from an image
alias dfimage="docker-run -v /var/run/docker.sock:/var/run/docker.sock --rm alpine/dfimage"
# Python linting
alias flake8="docker-run python:3-alpine flake8"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment