Using LocalStack Offline

I’m tinkering around with using LocalStack to mock out AWS for testing an application I’m working on. But the virtual environment I’m running it in doesn’t let me use the internet.

I was having some trouble getting LocalStack running to begin with, including getting caught in a restart loop that this thread helped me work through. However, I’m still running into some obstacles getting it to do anything. I’ve used Podman to go into the LocalStack container, ran python3 setup.py build successfully, then tried to run python3 setup.py install.

But it’s getting hung up on some package called apispec:

Processing dependencies for localstack==1.2.1.dev0
Searching for apispec>=5.1.1
Reading https://pypi.org/simple/apispec/
Download error on https://pypi.org/simple/apispec/: [Errno -3] Temporary failure in name resolution -- Some packages may not be found!

I’m really not an expert on this stuff, but looking through the build, it looks like there’s a good number of other dependencies it would need to download to emulate AWS. And looking at the pricing page, I see that a feature listed under Enterprise is “offline image”. Does this mean that in general, unless one gets the Enterprise version (or does some dark magic with Docker Compose, maybe), LocalStack in fact needs the internet to be used?

Hi @Anaxagoras , can you please share some details about your environment, and how you are installing LocalStack?

Please note that LocalStack ships as a Docker image (localstack/localstack image on Docker Hub), which has most of the required dependencies installed and baked into it. Have you been able to start up LocalStack as a Docker container? (using either the localstack start command line, or using docker-compose).

I’ve used Podman to go into the LocalStack container, ran python3 setup.py build successfully, then tried to run python3 setup.py install.

Can you please elaborate - it should not be required to run python3 setup.py install, as the image already contains (most of) the required libraries out of the box.

The easiest way to install and run a Hello World example would be:

  1. start up the LocalStack Docker container (either via localstack start, or via docker-compose)
  2. check that the services are available on local port 4566: curl localhost:4566/health
  3. make a request to one of the services via the awslocal command line, e.g., creating a bucket: awslocal s3 mb s3://test123

Please keep us posted on how it goes… Thanks!

2 Likes

Thanks for the response! I believe you’re right. I am able to run those simple commands, and do some tougher stuff like make buckets from other containers, copy in files, and read them out in yet another container. Still figuring out how to emulate my AWS setup so other parts can work with it, but I’m making progress!

1 Like