aws / aws-lambda-base-images

Apache License 2.0
648 stars 107 forks source link

Lambda images have null history - breaks podman builds with "internal error: history lists 1 non-empty layers, but we have 7 layers on disk" #2

Closed deuscapturus closed 3 years ago

deuscapturus commented 3 years ago

The lambda images from AWS have a null history which breaks builds with buildah or podman

buildah inspect amazon/aws-lambda-python:3.8 | jq .History
null
podman build .
STEP 1: FROM amazon/aws-lambda-python:3.8
STEP 2: COPY src/main.py ./main.py
Error: error committing container for step {Env:[LANG=en_US.UTF-8 TZ=:/etc/localtime PATH=/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin LD_LIBRARY_PATH=/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib LAMBDA_TASK_ROOT=/var/task LAMBDA_RUNTIME_DIR=/var/runtime] Command:copy Args:[src/main.py ./main.py] Flags:[] Attrs:map[] Message:COPY src/main.py ./main.py Original:COPY src/main.py ./main.py}: error copying layers and metadata for container "2bc8b77bc19da9635b2ec56b42127cf5a3efdc3541e6413f1de363a0f95d46f7": Error initializing source containers-storage:aws-lambda-python-working-container-1: internal error: history lists 1 non-empty layers, but we have 7 layers on disk
carlzogh commented 3 years ago

Hey @deuscapturus, thanks for reporting this.

As our images are not built from Dockerfiles, there isn't a default history generated for these images. This wasn't seen as mandatory as history is an optional field in the OCI spec (ref. https://github.com/opencontainers/image-spec/blob/e562b04403929d582d449ae5386ff79dd7961a11/config.md#properties).

We can however change our build process to generate one as the images are created - I've labelled this issue as enhancement, I'll report back when we have updates on this.

carlzogh commented 3 years ago

Hey @deuscapturus - reporting back, Lambda base images now have a history attached, thanks for bringing this up!

Please let us know if you encounter any further issues.