Last active
February 14, 2020 15:29
-
-
Save BenAtWide/8cd51c2eaf10dad5590a13f2b4b35ebc to your computer and use it in GitHub Desktop.
Handy docker commands in fish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get rid of docker containers that exited with status 1 | |
docker rm (docker ps -a -q --filter 'exited=1') | |
# connect to a running container, run bash cos probably no fish :-( | |
docker container exec -it <container name or id> bash | |
# or, to just run a command | |
docker exec -i <container name or id> sh -c "command arg args" | |
# Connect to an image, and have a poke around... | |
docker run --rm -it --entrypoint=/bin/bash <image name> | |
# Install compose | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-"(uname -s)"-"(uname -m) -o /usr/local/bin/docker-compose | |
# Run django cookiecutter commands | |
docker-compose -f local.yml run --rm django python manage.py makemigrations | |
docker-compose -f local.yml run --rm django python manage.py migrate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment