Last active
November 7, 2021 20:59
-
-
Save adamatan/dabc27bcb839cfcc640513133d77fc40 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
# Starts Two redis containers: db and CLI | |
docker network create redis-net | |
docker run -d --hostname redis-server --network=redis-net redis | |
docker run -it --network redis-net --rm redis redis-cli -h redis-server |
This file contains 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
#!/bin/bash | |
# Stops the redis-server container | |
# The CLI container should be | |
docker ps --latest --filter "ancestor=redis" --format "{{.ID}}" | xargs -n 1 docker stop | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment