1

I am using localstack version 0.12.19.4 on a Mac. I have created an s3 bucket called mybucket

localstack start     ------ s3 runs on port 4566
http://localhost:4566/health ---- everything is running
awslocal s3 mb s3://mybucket 
awslocal s3api put-bucket-acl --bucket mybucket --acl public-read

I add some files to my s3 bucket and then I check with awslocal and aws

    aws --endpoint-url=http://127.0.0.1:4566 s3 ls
    awslocal s3 ls

shows my bucket existing.

Now from a docker image, when I try to access one of the files in mybucket s3 bucket, I get the following error:

botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "http://localhost:4566/mybucket/dev/us/2020_08_11/eea9efc9-5970-426b-b867-9f57d6d9548f/850f35c8-0ada-44e4-96e1-e050e3040609"

when I check the contents of the s3 bucket, I do see the specific file existing.

one more fact when I retrieve docker port for localstack I see

4566/tcp -> 127.0.0.1:4566
4571/tcp -> 127.0.0.1:4571

Any ideas as to what I am doing wrong or missing?

reza
  • 5,972
  • 15
  • 84
  • 126
  • Does this answer your question? [From inside of a Docker container, how do I connect to the localhost of the machine?](https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach) – Anon Coward Nov 09 '21 at 00:46
  • the url of host.docker.internal was what I needed. Again thank you for the comment. – reza Nov 09 '21 at 16:45

0 Answers0