Hacker News new | ask | show | jobs
by moogly 651 days ago
I could not get LocalStack to work on Podman, to my chagrin. And no, doing the "sudo touch /etc/containers/nodocker" thing didn't solve it.
1 comments

  podman version
  podman pull public.ecr.aws/localstack/localstack:4.1
  podman run --detach --name lstack -p 4566:4566 public.ecr.aws/localstack/localstack:4.1
  # sorry, I don't have awscli handy
  export AWS_DEFAULT_REGION=us-east-1 AWS_ACCESS_KEY_ID=alpha AWS_SECRET_ACCESS_KEY=beta
  $HOMEBREW_PREFIX/opt/ansible/libexec/bin/python -c '
    import boto3
    sts = boto3.client("sts", endpoint_url="http://localhost:4566")
    print(sts.get_caller_identity())
    '
  {'UserId': 'AKIAIOSFODNN7EXAMPLE', 'Account': '000000000000', 'Arn': 'arn:aws:iam::000000000000:root', ...

I'll spare you the verbosity but

  2025-02-22T18:51:56.427  INFO --- [et.reactor-0] localstack.request.aws     : AWS s3.CreateBucket => 200
  2025-02-22T18:52:14.332  INFO --- [et.reactor-0] localstack.request.aws     : AWS s3.PutObject => 200

  cat > sample-stack.yaml <<'YAML'
  AWSTemplateFormatVersion: 2010-09-09
  Resources:
    Iam0:
      Type: AWS::IAM::Role
      Properties:
        RoleName: Iam0
        ManagedPolicyArns:
        - arn:aws:iam::aws:policy/AdministratorAccess
        AssumeRolePolicyDocument:
          Principal:
            AWS:
              Ref: AWS::AccountId
          Effect: Allow
          Action: sts:AssumeRole
  YAML
  create_stack_command_goes_here
  2025-02-22T18:55:02.657  INFO --- [et.reactor-0] localstack.request.aws     : AWS cloudformation.CreateStack => 200
---

ed: ah, I bet you mean the lambda support; FWIW they do call out explicit support for Podman[1] but in my specific setup I had to switch it to use -e DOCKER_HOST=tcp://${my_vm_ip}:2375 and then $(podman system service tcp://0.0.0.0:2375) in the lima vm due to the podman.sock being chown to my macOS UID. My life experience is that engineering is filled with this kind of shit

I used https://github.com/aws-samples/aws-cloudformation-inline-pyt... to end-to-end test it

1: https://github.com/localstack/localstack/blob/v4.1.1/localst...