Skip to content

Commit 0910387

Browse files
feat: PREVIEWAPI-476 build zip layers
1 parent f96ac89 commit 0910387

6 files changed

Lines changed: 14 additions & 38 deletions

File tree

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
ARG BASE_IMAGE
2-
ARG GS_VERSION
3-
ARG GS_TAG
42

53
FROM ${BASE_IMAGE}
64

5+
ARG GS_VERSION
6+
ARG GS_TAG
7+
78
RUN yum install -y wget tar xz zip gcc make
89

9-
RUN mkdir /usr/local/src/ghostscript && \
10+
RUN echo "Building Ghostscript version: $GS_VERSION (tag: $GS_TAG)" && \
11+
mkdir /usr/local/src/ghostscript && \
1012
cd /usr/local/src/ghostscript && \
1113
wget -qO - https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/$GS_TAG/ghostscript-$GS_VERSION.tar.xz | tar -Jxf - && \
1214
cd ghostscript-$GS_VERSION && \

README.md

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ run on Amazon Linux 2:
2828

2929
| Ghostscript | x86_64 VERSION | ARM64 VERSION | eu-west-3 x86_64 | eu-west-3 ARM64 |
3030
|-------------|----------------|---------------|------------------|-----------------|
31-
| v10.06.0 | TBD | TBD | TBD | TBD |
31+
| v10.06.0 | 18 | 1 | 19 | 1 |
3232
| v10.04.0 | 17 | - | 18 | - |
3333
| v10.02.0 | 15 | - | 16 | - |
3434
| v10.0.0 | 13 | - | 14 | - |
@@ -44,37 +44,13 @@ You can find it at `/opt/bin/gs` (`/opt` is where Lambda unpacks layers).
4444

4545
You can run `/opt/bin/gs --version` to make sure Ghostscript is up and running.
4646

47-
## Building Locally
48-
49-
### Requirements
50-
- Docker with multi-platform support (Docker Desktop includes buildx by default)
51-
- For ARM64 builds: Docker buildx must be enabled
52-
53-
### Build Process
54-
Run the build script to create both architecture variants:
55-
```bash
56-
./build.sh
57-
```
58-
59-
This will produce:
60-
- `ghostscript-x86_64.zip` - x86_64 architecture
61-
- `ghostscript-arm64.zip` - ARM64 architecture
62-
63-
### Publishing Locally
64-
To publish layers manually (requires AWS credentials and proper permissions):
65-
```bash
66-
export TARGET_REGION="us-east-1"
67-
export BASE_DIR="$(pwd)" # Optional: defaults to current directory
68-
./publish.sh
69-
```
70-
71-
## Updating to a New Ghostscript Version
47+
## Update
7248

7349
1. Change version numbers in the `version.sh` file (GHOSTSCRIPT_VERSION and GS_TAG)
74-
2. Test locally by running `./build.sh` to produce both zip files
75-
3. Verify the builds: `unzip -l ghostscript-x86_64.zip` and `unzip -l ghostscript-arm64.zip`
76-
4. Publish the new layers using `./publish.sh` (set TARGET_REGION and BASE_DIR as needed)
77-
5. Update the version table in this README with the new layer version numbers
50+
2. Run `./build.sh` script which will produce `ghostscript-x86_64.zip` and `ghostscript-arm64.zip` files in the root of the project
51+
3. Update the version table in this README with the new layer version numbers
52+
4. Commit & Create a Pull Request
53+
5. After merging, a new layer version will be published by the CI automatically
7854

7955
## License
8056

build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ echo "Note: ARM64 builds require Docker with multi-platform support (buildx)"
1111
echo ""
1212
echo "Building x86_64 layer..."
1313
docker build \
14-
--build-arg BASE_IMAGE=public.ecr.aws/lambda/provided:al2 \
14+
--build-arg BASE_IMAGE=amazonlinux:2 \
1515
--build-arg GS_VERSION=${GHOSTSCRIPT_VERSION} \
1616
--build-arg GS_TAG=${GS_TAG} \
17+
--platform linux/x86_64 \
1718
-t gs-lambda-layer-x86_64 .
1819
docker run --rm gs-lambda-layer-x86_64 cat /tmp/gs.zip > ./ghostscript-x86_64.zip
1920
echo "✓ Created ghostscript-x86_64.zip"
@@ -22,7 +23,7 @@ echo "✓ Created ghostscript-x86_64.zip"
2223
echo ""
2324
echo "Building ARM64 layer..."
2425
docker build \
25-
--build-arg BASE_IMAGE=public.ecr.aws/lambda/provided:al2-arm64 \
26+
--build-arg BASE_IMAGE=amazonlinux:2 \
2627
--build-arg GS_VERSION=${GHOSTSCRIPT_VERSION} \
2728
--build-arg GS_TAG=${GS_TAG} \
2829
--platform linux/arm64 \

ghostscript-arm64.zip

13 MB
Binary file not shown.

ghostscript-x86_64.zip

12.8 MB
Binary file not shown.

ghostscript.zip

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)