Skip to content

Gs10051 upgrade #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 30 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
FROM lambci/lambda-base-2:build
ENV GS_TAG=gs10040
ENV GS_VERSION=10.04.0
FROM ubuntu:latest

RUN yum install -y wget
ENV DEBIAN_FRONTEND=noninteractive
ENV GS_TAG=gs10051
ENV GS_VERSION=10.05.1

RUN mkdir /usr/local/src/ghostscript && \
cd /usr/local/src/ghostscript && \
wget -qO - https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/$GS_TAG/ghostscript-$GS_VERSION.tar.gz | tar -zxf - && \
cd ghostscript-$GS_VERSION && \
./configure --without-luratech && \
make && make install
# Install system build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
wget \
curl \
zip \
gcc \
g++ \
make \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN cd /usr/local && \
zip /tmp/gs.zip bin/gs
# Build and install Ghostscript
RUN mkdir -p /usr/local/src/ghostscript && \
cd /usr/local/src/ghostscript && \
wget -q https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/${GS_TAG}/ghostscript-${GS_VERSION}.tar.gz && \
tar -zxf ghostscript-${GS_VERSION}.tar.gz && \
cd ghostscript-${GS_VERSION} && \
./configure --without-luratech && \
make -j$(nproc) && \
make install

# Package /opt directory as Lambda layer zip
RUN mkdir -p /opt/bin && \
cp /usr/local/bin/gs /opt/bin/ && \
cd /opt && \
zip -r /tmp/ghostscript.zip .
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ run on Amazon Linux 2:

| Ghostscript | VERSION | eu-west-3 |
|-------------|---------|-----------|
| v10.05.1 | 18 | 19 |
| v10.04.0 | 17 | 18 |
| v10.02.0 | 15 | 16 |
| v10.0.0 | 13 | 14 |
Expand Down
12 changes: 11 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/usr/bin/env bash
set -e

echo "Building Docker image..."
docker build -t gs-lambda-layer .
docker run --rm gs-lambda-layer cat /tmp/gs.zip > ./ghostscript.zip

echo "Creating container..."
container_id=$(docker create gs-lambda-layer sleep 1)

echo "Copying built Lambda layer ZIP to host..."
docker cp "$container_id":/tmp/ghostscript.zip ./ghostscript.zip

echo "Cleaning up container..."
docker rm "$container_id"
4 changes: 2 additions & 2 deletions ghostscript.zip
Git LFS file not shown
2 changes: 1 addition & 1 deletion publish.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

GHOSTSCRIPT_VERSION=10.04.0
GHOSTSCRIPT_VERSION=10.05.1
LAYER_NAME='ghostscript'
LAYER_VERSION=$(
aws lambda publish-layer-version --region "$TARGET_REGION" \
Expand Down