-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·36 lines (31 loc) · 1.08 KB
/
build.sh
File metadata and controls
executable file
·36 lines (31 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
set -e
# Source version configuration
source "$(dirname "$0")/version.sh"
echo "Building Ghostscript ${GHOSTSCRIPT_VERSION} for x86_64 and ARM64..."
echo "Note: ARM64 builds require Docker with multi-platform support (buildx)"
# Build for x86_64
echo ""
echo "Building x86_64 layer..."
docker build \
--build-arg BASE_IMAGE=amazonlinux:2 \
--build-arg GS_VERSION=${GHOSTSCRIPT_VERSION} \
--build-arg GS_TAG=${GS_TAG} \
--platform linux/x86_64 \
-t gs-lambda-layer-x86_64 .
docker run --rm gs-lambda-layer-x86_64 cat /tmp/gs.zip > ./ghostscript-x86_64.zip
echo "✓ Created ghostscript-x86_64.zip"
# Build for ARM64
echo ""
echo "Building ARM64 layer..."
docker build \
--build-arg BASE_IMAGE=amazonlinux:2 \
--build-arg GS_VERSION=${GHOSTSCRIPT_VERSION} \
--build-arg GS_TAG=${GS_TAG} \
--platform linux/arm64 \
-t gs-lambda-layer-arm64 .
docker run --rm --platform linux/arm64 gs-lambda-layer-arm64 cat /tmp/gs.zip > ./ghostscript-arm64.zip
echo "✓ Created ghostscript-arm64.zip"
echo ""
echo "Build complete! Generated files:"
ls -lh ghostscript-*.zip