Skip to content

Instantly share code, notes, and snippets.

@davidmerrick
Last active August 8, 2019 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidmerrick/db6cf82a279d59485ffc2d5de368940e to your computer and use it in GitHub Desktop.
Save davidmerrick/db6cf82a279d59485ffc2d5de368940e to your computer and use it in GitHub Desktop.
Running localstack in Docker

Start localstack with just S3 running on port 4572 in region us-west-2.

docker run -e "SERVICES=s3:4572" -e "DEFAULT_REGION=us-west-2" -p 4572:4572 localstack/localstack

Create an S3 bucket:

aws --endpoint-url=http://localhost:4572 s3 mb s3://test-bucket

List buckets:

aws --endpoint-url=http://localhost:4572 s3 ls

You should see the bucket you just created.

Upload an object to your bucket:

touch ~/Desktop/foo.txt
aws --endpoint-url=http://localhost:4572 s3 cp ~/Desktop/foo.txt s3://test-bucket

List objects in your bucket:

aws --endpoint-url=http://localhost:4572 s3 ls s3://test-bucket

You should see the file you uploaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment