Skip to content

Commit 2581f6a

Browse files
committed
fix: docker build sripts and image
1 parent 7439a01 commit 2581f6a

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

layers/make-poppler-layer-amd64.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

34
# Build the container
4-
docker buildx build --platform linux/amd64 -f poppler.Dockerfile -t poppler-lambda-layer-amd64 .
5+
docker buildx build --platform linux/amd64 -f ./layers/poppler.Dockerfile -t poppler-lambda-layer-amd64 ./layers
56

67
# Run a container and copy out the zip then delete it
78
CONTAINER_ID=$(docker create --platform linux/amd64 poppler-lambda-layer-amd64)

layers/make-poppler-layer-arm64.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

34
# Build the container
4-
docker buildx build --platform linux/arm64 -f poppler.Dockerfile -t poppler-lambda-layer-arm64.
5+
docker buildx build --platform linux/arm64 -f ./layers/poppler.Dockerfile -t poppler-lambda-layer-arm64 ./layers
56

67
# Run a container and copy out the zip then delete it
78
CONTAINER_ID=$(docker create --platform linux/arm64 poppler-lambda-layer-arm64)

layers/poppler.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ FROM public.ecr.aws/lambda/provided:al2023 AS builder
33

44
# Install required dependencies
55
RUN dnf -y update && \
6-
dnf -y install poppler poppler-utils poppler-data && \
6+
dnf -y install poppler poppler-utils poppler-data zip && \
77
dnf clean all
88

99
# Copy bundling helper script
1010
COPY ./copy-dep.sh /tmp/copy-dep.sh
1111

1212
# Create output bundle directory
13-
RUN mkdir -p /bundle/opt/bin /bundle/opt/lib /bundle/opt/fonts /bundle/opt/fontconfig /bundle/opt/poppler-data
13+
RUN mkdir -p /bundle/opt/bin /bundle/opt/lib /bundle/opt/etc /bundle/opt/etc/fonts /bundle/opt/share /bundle/opt/share/poppler-data
1414

1515
# Copy required cli tools and their dependencies
1616
RUN chmod +x /tmp/copy-dep.sh && \
@@ -30,4 +30,4 @@ RUN cp -r /usr/share/fonts/* /bundle/opt/fonts/ && \
3030
RUN chmod -R 755 /bundle/opt
3131

3232
# Zip up the bundle as the layer
33-
RUN zip /bundle /poppler-lambda-layer.zip
33+
RUN zip -r /poppler-lambda-layer.zip /bundle

0 commit comments

Comments
 (0)