Background: I was trying to run react-snap, which uses Puppeteer and headless chromium to generate HTML from javascript (React in this case). I actually was able to get it working in the default Amazon Linux build image eventually, but it left me super curious as to how to use a custom image.
When I try to use a custom image by pointing to a Docker Hub repo, the AWS Amplify build process fails with no log output. I am able to use this image locally without problems, so I suspect that I just don't understand what I need to provide for Amplify to run it.
According to the documentation, pulling from Docker Hub is supported, and it needs to have curl, git, openssh, and node for node projects. However, it doesn't have an example Dockerfile, or go into detail about what is actually run in the container.
This is the Dockerfile I used to test (with a bind mount) to confirm that this image contains everything I need to compile locally:
FROM alpine
RUN apk add --no-cache \
npm \
chromium \
curl \
openssh \
git
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
WORKDIR /app
I pushed it to Dockerhub @ ertw/react-snap-builder so that I could reference it from AWS Amplify.
It seems Alpine is not supported yet: https://github.com/aws-amplify/amplify-console/issues/100#issuecomment-528598420
This is the minimal image that worked for me: http://github.com/butaca/amplify-hugo (be aware that I'm new to Docker).
Note that at the time of writing Node is mandatory even for non Node apps.