TexturePacker CI installation with Docker

This documentation article explains how to use TexturePacker in your CI system such as Jenkins or GitLab.

Running TexturePacker on a Server (CI, Docker,...) requires a TexturePacker Docker/CI license
Using a regular Single User or Volume license is not permitted and will not work!
Please contact CodeAndWeb for such a license.

Docker installation

Installing TexturePacker inside Docker is not hard to accomplish. Follow these steps for a simple setup:

1. Download TexturePacker

Download the current Ubuntu version of TexturePacker and rename it to TexturePacker.deb.

2. Create a Dockerfile

This simple Dockerfile uses the current version of Ubuntu and installs all required files. It assumes that the downloaded TexturePacker.deb from step 1) is in the same directory.

FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive

# Copy pre-downloaded TexturePacker.deb package into container
COPY TexturePacker.deb /tmp

# Install dependencies and TexturePacker, cleanup
RUN apt-get update \
&&  apt-get -y install libegl1-mesa libgl1-mesa-glx \
                       libfontconfig libx11-6 libxkbcommon-x11-0 \
                       /tmp/TexturePacker.deb \
&&  rm -rf /var/lib/apt/lists/*

# Uncomment this line if you agree to the license terms
# RUN echo agree | TexturePacker --version

3. Build the image

Build the image and install TexturePacker

docker build -t texturepacker:latest .

Run TexturePacker to read the license agreement.

docker run texturepacker:latest TexturePacker

If you agree with the license terms uncomment the last line in the Dockerfile. This saves your agreement in the image. TexturePacker won't ask you again to agree when you use this image.

docker build -t texturepacker:latest .

Running TexturePacker on a CI system

A docker license is a floating license that claims a "seat" when TexturePacker is started and automatically releases the license after the packing process. This is why the license has to be passed as parameter for each run of TexturePacker.

Use a bind-mount to mount your sprite sheet directories and run the packing process:

docker run texturepacker:latest \
--mount type=bind,source=/tmp/spritesheets,target=/spritesheets \
TexturePacker --activate-license [YOUR-LICENSE-KEY] /spritesheets/*.tps