generated from devcontainers/template-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add initial version of localstack-dind
- Loading branch information
Showing
5 changed files
with
208 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "LocalStack DinD setup", | ||
"image": "mcr.microsoft.com/devcontainers/base:${templateOption:imageVariant}", | ||
|
||
"remoteEnv": { | ||
// Activate LocalStack Pro: https://docs.localstack.cloud/getting-started/auth-token/ | ||
"LOCALSTACK_AUTH_TOKEN": "${localEnv:LOCALSTACK_AUTH_TOKEN}", // required for Pro, not processed via template due to security reasons | ||
// LocalStack configuration: https://docs.localstack.cloud/references/configuration/ | ||
"ACTIVATE_PRO": "${templateOption:usePro}", | ||
"DEBUG": "${templateOption:debug}", | ||
"LS_LOG": "${templateOption:logLevel}", | ||
"PERSISTENCE": "${templateOption:persistence}", | ||
"AWS_ENDPOINT_URL": "http://${templateOption:host}", | ||
"LOCALSTACK_HOST": "${templateOption:host}", | ||
"AUTO_LOAD_POD": "${templateOption:loadPods}", | ||
"IAM_ENFORCE": "${templateOption:enforceIam}", | ||
"AWS_REGION": "${templateOption:defaultRegion}", | ||
"AWS_DEFAULT_REGION": "${templateOption:defaultRegion}" | ||
}, | ||
|
||
// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/localstack/devcontainer-feature/localstack-cli:latest": { | ||
"awslocal": ${templateOption:awslocal}, | ||
"cdklocal": ${templateOption:cdklocal}, | ||
"pulumilocal": ${templateOption:pulumilocal}, | ||
"samlocal": ${templateOption:samlocal}, | ||
"tflocal": ${templateOption:tflocal} | ||
} | ||
}, | ||
|
||
// 👇 Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "${templateOption:startup} && localstack start -d", | ||
"mounts": [{ "source": "dind-var-lib-docker", "target": "/var/lib/docker", "type": "volume" }] // to persist build data and images | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
{ | ||
"id": "localstack", | ||
"version": "0.1.0", | ||
"name": "LocalStack DinD", | ||
"description": "A template to manage LocalStack in DinD via CLI", | ||
"documentationURL": "https://github.com/localstack/devcontainer-template/tree/main/src/localstack", | ||
"licenseURL": "https://github.com/localstack/devcontainer-template/blob/main/LICENSE", | ||
"options": { | ||
"imageVariant": { | ||
"type": "string", | ||
"description": "Debian version (use bullseye or jammy on local arm64/Apple Silicon):", | ||
"proposals": [ | ||
"jammy", | ||
"focal", | ||
"bullseye", | ||
"buster" | ||
], | ||
"default": "jammy" | ||
}, | ||
"awslocal": { | ||
"type": "boolean", | ||
"description": "Install LocalStack wrapper for AWS CLI:", | ||
"default": "false" | ||
}, | ||
"cdklocal": { | ||
"type": "boolean", | ||
"description": "Install LocalStack wrapper for CDK:", | ||
"default": "false" | ||
}, | ||
"pulumilocal": { | ||
"type": "boolean", | ||
"description": "Install LocalStack wrapper for Pulumi:", | ||
"default": "false" | ||
}, | ||
"samlocal": { | ||
"type": "boolean", | ||
"description": "Install LocalStack wrapper for AWS SAM CLI:", | ||
"default": "false" | ||
}, | ||
"tflocal": { | ||
"type": "boolean", | ||
"description": "Install LocalStack wrapper for Terraform:", | ||
"default": "false" | ||
}, | ||
"logLevel": { | ||
"type": "string", | ||
"description": "Set LocalStack log level:", | ||
"enum": [ | ||
"trace", | ||
"trace-internal", | ||
"debug", | ||
"info", | ||
"warn", | ||
"error", | ||
"warning" | ||
], | ||
"default": "info" | ||
}, | ||
"host": { | ||
"type": "string", | ||
"descripiton": "LocalStack hostname:", | ||
"proposals": [ | ||
"localhost.localstack.cloud:4566" | ||
], | ||
"default": "localhost.localstack.cloud:4566" | ||
}, | ||
"debug": { | ||
"type": "boolean", | ||
"descripiton": "Enable LocalStack debugging:", | ||
"default": "false" | ||
}, | ||
"persistence": { | ||
"type": "boolean", | ||
"descripiton": "Enable persistence in LocalStack:", | ||
"default": "false" | ||
}, | ||
"usePro": { | ||
"type": "boolean", | ||
"descripiton": "Enable LocalStack Pro:", | ||
"default": "false" | ||
}, | ||
"version": { | ||
"type": "string", | ||
"descripiton": "Use LocalStack version:", | ||
"proposals": [ | ||
"latest", | ||
"3.5.0", | ||
"3.4.0", | ||
"3.3.0", | ||
"3.2.0", | ||
"3.1.0", | ||
"3.0.2", | ||
"3.0.1" | ||
], | ||
"default": "latest" | ||
}, | ||
"loadPods": { | ||
"type": "string", | ||
"descripiton": "Load Cloud Pods at start-up (comma-separated list):", | ||
"default": " " | ||
}, | ||
"volumePath": { | ||
"type": "string", | ||
"descripiton": "LocalStack volume location on the host (currently only local (bind) mounts recommended):", | ||
"default": "./volume" | ||
}, | ||
"enforceIam": { | ||
"type": "boolean", | ||
"descripiton": "Enforce IAM:", | ||
"default": "false" | ||
}, | ||
"defaultRegion": { | ||
"type": "string", | ||
"descripiton": "Default AWS region:", | ||
"proposals": [ | ||
"us-east-1", | ||
"us-east-2", | ||
"us-west-1", | ||
"us-west-2", | ||
"af-south-1", | ||
"ap-east-1", | ||
"ap-south-1", | ||
"ap-south-2", | ||
"ap-southeast-1", | ||
"ap-southeast-2", | ||
"ap-southeast-3", | ||
"ap-southeast-4", | ||
"ap-northeast-1", | ||
"ap-northeast-2", | ||
"ap-northeast-3", | ||
"ca-central-1", | ||
"ca-west-1", | ||
"eu-central-1", | ||
"eu-central-2", | ||
"eu-west-1", | ||
"eu-west-2", | ||
"eu-west-3", | ||
"eu-south-1", | ||
"eu-south-2", | ||
"eu-north-1", | ||
"il-central-1", | ||
"me-south-1", | ||
"me-central-1", | ||
"sa-east-1" | ||
], | ||
"default": "us-east-1" | ||
}, | ||
"startup": { | ||
"type": "boolean", | ||
"description": "Start up LocalStack:", | ||
"default": "true" | ||
} | ||
}, | ||
"platforms": [ | ||
"Any" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"awslocal": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
cd $(dirname "$0") | ||
source test-utils.sh | ||
|
||
# Template specific tests | ||
check "distro" lsb_release -c | grep "jammy" | ||
check "localstack status" localstack status | ||
check "localstack stops" localstack stop | ||
|
||
# Report result | ||
reportResults |