Local Testing

Testing of the Docker images via udocker

You can test locally if the Docker image will be able to run in AWS Lambda by means of udocker (available in the lambda directory) and taking into account the following limitations:

  • udocker cannot run on macOS. Use a Linux box instead.
  • Images based in Alpine will not work.

Procedure for testing:

  1. (Optional) Define an alias for easier usage:

    alias udocker=`pwd`/lambda/udocker
  1. Pull the image from Docker Hub into udocker:

    udocker pull grycap/cowsay
  2. Create the container:

    udocker create --name=ucontainer grycap/cowsay
  3. Change the execution mode to Fakechroot:

    udocker setup --execmode=F1 ucontainer
  4. Execute the container:

    udocker run ucontainer
  5. (Optional) Get a shell into the container:

    udocker run ucontainer /bin/sh

Further information is available in the udocker documentation:

udocker help