Allow specifying a custom Docker image name and registry
Description
This pull request enhances the setup-localstack action by introducing a new input, image-name. This allows users to specify a full Docker image name, including a custom registry (e.g., my.registry.com/localstack/localstack:latest), rather than being limited to images hosted on Docker Hub, for when organizational policies restrict where images are allowed to be pulled from.
The action has been updated to prioritize the image-name input. If it is provided, it will be used directly to pull the LocalStack image (populating the $IMAGE_NAME environment variable). If it is not provided, the action will fall back to the existing behavior of constructing the image name using the image-tag input.
This change provides greater flexibility for users who manage their own Docker registries or use mirrors.
Changes
- Add the
image-nameinput inaction.ymland pass it to thestartupsub-action. - Update
startup/action.ymlto accept theimage-nameinput and modify the startup logic to prioritize it overimage-tag(directly populating$IMAGE_NAME). - Update the documentation in
README.mdto include the newimage-nameinput.
How to use
To use a custom image, simply add the image-name input to your workflow:
- name: Start LocalStack from a custom registry
uses: LocalStack/[email protected]
with:
image-name: 'my.registry.com/localstack/localstack-pro:latest'
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}