TIL: Docker Commands

TIL: Docker Commands

I set up my main project at work to utilize LocalStack this week. I wasn't able to get it working using a virtual environment with Python, but another project at work has it set up through Docker. A coworker that is much more familiar with Docker than I am helped me get set up. Along the way, I saved these Docker commands that have already served me pretty well in debugging/figuring out what's going on in my containers:

docker compose logs -f localstack # see the logs for the localstack container

docker compose up -d localstack # -d flag is for daemon which runs in the background. Can be useful to omit to see if something is failing on startup

docker compose up -d --build web # force a rebuild

docker compose exec web bash # go into shell on the web docker container

docker compose exec localstack awslocal s3 ls s3://localstack-s3 --recursive # view files in the bucket `s3://localstack-s3` in the `localstack` container, recursively.