Skip to content

Commit

Permalink
Initial dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kyori19 committed Mar 10, 2021
1 parent 381a865 commit 0538cc5
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 1 deletion.
61 changes: 61 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM alpine:3.13.2

ARG version
ENV VERSION=${version} \
\
DEV_PKGS="autoconf automake curl gcc git gperf g++ libtool make nasm pkgconfig python3 ragel" \
PREFIX=/tmp/output \
PKG_CONFIG_PATH="/tmp/output/lib/pkgconfig"

RUN apk add --no-cache ${DEV_PKGS} &&\
# freetype
git clone --recurse-submodules https://gitlab.freedesktop.org/freetype/freetype.git /tmp/freetype -b VER-2-10-4 --depth 1 &&\
cd /tmp/freetype &&\
./autogen.sh &&\
./configure --prefix="${PREFIX}" --disable-static --enable-shared &&\
make &&\
make install &&\
# fribidi
git clone https://github.com/fribidi/fribidi.git /tmp/fribidi -b v1.0.10 --depth 1 &&\
cd /tmp/fribidi &&\
./autogen.sh --prefix="${PREFIX}" --disable-static --enable-shared &&\
make &&\
make install &&\
# harfbuzz
git clone https://github.com/harfbuzz/harfbuzz.git /tmp/harfbuzz -b 2.7.4 --depth 1 &&\
cd /tmp/harfbuzz &&\
./autogen.sh --prefix="${PREFIX}" --disable-static --enable-shared &&\
make &&\
make install &&\
# libxml2
git clone https://gitlab.gnome.org/GNOME/libxml2.git /tmp/libxml2 -b v2.9.10 --depth 1 &&\
cd /tmp/libxml2 &&\
./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no &&\
make &&\
make install &&\
# fontconfig
mkdir -p /tmp/fontconfig &&\
cd /tmp/fontconfig &&\
curl -sL https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.93.tar.gz | tar -zx --strip-components=1 &&\
./configure --prefix="${PREFIX}" --disable-static --enable-shared --enable-libxml2 &&\
# https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/272
for i in doc/*.fncs; do \
touch -r $i ${i//.fncs/.sgml}; \
done &&\
make &&\
make install &&\
# libass
git clone https://github.com/libass/libass.git /tmp/libass -b ${VERSION} --depth 1 &&\
cd /tmp/libass &&\
./autogen.sh &&\
./configure --prefix="${PREFIX}" --disable-static --enable-shared &&\
make &&\
make install &&\
rm -rf /tmp/freetype &&\
rm -rf /tmp/fribidi &&\
rm -rf /tmp/harfbuzz &&\
rm -rf /tmp/libxml2 &&\
rm -rf /tmp/fontconfig &&\
rm -rf /tmp/libass &&\
apk del ${DEV_PKGS} &&\
cp -r ${PREFIX} /output/
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
# libass-alpine
# libass-alpine

Docker image with [libass](https://github.com/libass/libass) built in alpine.

If you find any outdated package, please report in [issues](https://github.com/kyori19/libass-alpine/issues).

## Tags

* `latest`: Latest stable version

## Usage

```Dockerfile
FROM kyori/libass-alpine:latest AS libass

FROM alpine:3.13.2

COPY --from=libass /output/ /

# If you placed files to other than `/`, add this line
ENV PKG_CONFIG_PATH=${YOUR_INSTALL_PATH}/lib/pkgconfig
```

## License

```LICENSE
Copyright 2021 kyori19
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
libass:
build:
context: .
dockerfile: Dockerfile
args:
version: 0.15.0
image: kyori/libass-alpine
3 changes: 3 additions & 0 deletions hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

docker build --build-arg version=${DOCKER_TAG} -f ${DOCKERFILE_PATH} -t ${IMAGE_NAME} .
4 changes: 4 additions & 0 deletions hooks/post_push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

docker tag ${IMAGE_NAME} ${DOCKER_REPO}:latest
docker push ${DOCKER_REPO}:latest

0 comments on commit 0538cc5

Please sign in to comment.