Skip to content

Instantly share code, notes, and snippets.

@adamatan
Last active November 7, 2021 20:59
Show Gist options
  • Save adamatan/dabc27bcb839cfcc640513133d77fc40 to your computer and use it in GitHub Desktop.
Save adamatan/dabc27bcb839cfcc640513133d77fc40 to your computer and use it in GitHub Desktop.
#!/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
#!/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