-
Couldn't load subscription status.
- Fork 95
π³ π dockerized version of awscli-local #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π³ π dockerized version of awscli-local #90
Conversation
* Add specific versions in docker-compose * Add correct entrypoint execution
The binary needs to use the venv python installed to avoid using the one from the system. A new version must remove this step to avoid confusion and end up having 2 python installations in the same docker image. For now, since there are multiple python instances, the system is pointing to an older version, while venv has a newer version python 3.13. So, the awslocal-docker has the proper call as the order of PATH needs to be respected so that the AWS-cliv2 is loaded beore aws-v1 added by the python bindings.
>>> import awscli Traceback (most recent call last): File "<python-input-0>", line 1, in <module> import awscli ModuleNotFoundError: No module named 'awscli' >>>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you are copy/pasting the entire file just to change the shebang. That will be difficult to maintain and seems unnecessary.
Since you already change the path with PATH="/venv/bin:$PATH", it should automatically use the virtualenv because /venv/bin/python is the first python that will be found. E.g.
$ python3 -m venv /tmp/venv
$ PATH="/tmp/venv/bin:$PATH" which python
/tmp/venv/bin/python
I would remove bin/awslocal-docker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the problem here is to support both aws-cliv2 and the aws-cli python bindings... Couldn't find a way to specify them, but I will try to remove it...
@mattviasat
mattviasat
Mar 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need the copy of the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the whole problem here is that the image has python 3.13 installed with the command venv creation... I will remove that step and see if it's possible to keep a single installation and, as a result, decrease the image size.
Co-authored-by: mattviasat <129442476+mattviasat@users.noreply.github.com>
mattviasat
commented
Apr 1, 2025
The other thing I would say is that it might be easier to just call awslocal inside the existing localstack image, rather than creating a new image that just containers awslocal.
The other thing I would say is that it might be easier to just call awslocal inside the existing localstack image, rather than creating a new image that just containers awslocal.
Thank you for all your suggestions... I just need a smaller image to account for SBOM, security, etc... This is specific for a cloudNative platform and I don't need to pull the entire localstack image for the use cases that I have...
mattviasat
commented
Apr 7, 2025
Thank you for all your suggestions... I just need a smaller image to account for SBOM, security, etc... This is specific for a cloudNative platform and I don't need to pull the entire localstack image for the use cases that I have...
I think there is probably a simpler way that results in a smaller image. You could use python/python3.x image and just
python3 -m venv /venv/
/venv/bin/python3 -m pip install --no-cache-dir awscli-local
/venv/bin/awslocal help
mattviasat
commented
May 20, 2025
The other thing I would say is that it might be easier to just call awslocal inside the existing localstack image, rather than creating a new image that just containers awslocal.
Thank you for all your suggestions... I just need a smaller image to account for SBOM, security, etc... This is specific for a cloudNative platform and I don't need to pull the entire localstack image for the use cases that I have...
If you are running localstack in one docker container, than i believe you should already have the image stored locally.
If you need to interact with an existing localstack container you can either:
execinto the running container to run a command.awslocalis installed inlocalstack/localstackand you know it will be the right version.- Use init hooks to create as stack when the containers comes up https://docs.localstack.cloud/references/init-hooks/#lifecycle-stages-and-hooks
- or if you insist on running a different container,
docker run -e awslocal localstack/localstack <my command here>
you would need to set up the ports and allow it to talk to the originallocalstack/localstackcontainer, but it should work.
Uh oh!
There was an error while loading. Please reload this page.
π New Version
ποΈ Build
π Running
β Testing
π§ Localstack Deployment
π§ AWS Lambda Deploy example