I'm migrating my team's CI workflows from Earthly to Dagger, and have been successful up until this point where I'm migrating our integration test workflows. Specifically, with Earthly, our integration tests run alongside Localstack in a dind container:
FROM earthly/dind:alpine
COPY tests/integration/aws/docker-compose.yml .
RUN --secret LOCALSTACK_AUTH_TOKEN=+secrets/LOCALSTACK_AUTH_TOKEN \
echo "LOCALSTACK_AUTH_TOKEN=$LOCALSTACK_AUTH_TOKEN" > .env
# Consider adding a setup service to create initial resources
WITH DOCKER --load=+integration-snapshot-image \
--compose docker-compose.yml \
--service localstack
RUN docker run --network=host lacework/sidekick-integrationtest:snapshot-latest
END
As documented here, WITH DOCKER ... END starts a Docker daemon to execute the contained commands against it.