Skip to content
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

Dind lambda #127

Open
sylvain-blot-sp opened this issue Oct 25, 2024 · 1 comment
Open

Dind lambda #127

sylvain-blot-sp opened this issue Oct 25, 2024 · 1 comment

Comments

@sylvain-blot-sp
Copy link

Hello folks,

If anyone is passing by and is trying docker dind here is my recipe to make it works:

---
extraEnvVars:
  - name: LOCALSTACK_HOST
    value: "localstack.default.svc:4566"
  - name: HOSTNAME_FROM_LAMBDA
    value: "172.17.0.1"
  - name: LAMBDA_DOCKER_FLAGS
    value: "--add-host=host.docker.internal:host-gateway"

mountDind:
  enabled: true
  forceTLS: false
  image: "docker:27.3.1-dind"

volumes:
  - name: localstack-boot-scripts-config
    configMap:
      name: localstack-boot-scripts-config
      defaultMode: 493

volumeMounts:
  - name: localstack-boot-scripts-config
    mountPath: /etc/localstack/init/boot.d

extraDeploy:
  - |
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: localstack-boot-scripts-config
    data:
      localstack-boot-scripts-config.sh: |
        #!/bin/bash
        
        until [[ "$(curl localhost:2375/_ping)" == "OK" ]]; do
          echo 'docker not ready' && sleep 1
        done
        echo 'docker is ready'

The boot script unsure docker is ready when LocalStack starts, if TLS is disabled docker takes time to start. Also don't use that in production :)

@alexrashed
Copy link
Member

Thanks @sylvain-blot-sp for the recipe. This is quite a lot of config, could you explain what the different issues were that you faced when using the DIND mode?
Maybe we can tackle these issues such that it doesn't have to be that complicated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants