docker build -t lua-vips .
docker run --rm -it \
-v $PWD:/data \
lua-vips:latest \
lua main.lua
Last active
February 10, 2025 07:37
-
-
Save monochromer/a050968533fa238f41bf3e658dc18031 to your computer and use it in GitHub Desktop.
Dockerfile for `lua` and `vips`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.21.0 | |
RUN apk add --no-cache --update \ | |
make \ | |
gcc \ | |
musl-dev | |
RUN apk add --no-cache --update \ | |
vips \ | |
vips-dev \ | |
# cli tools if you need | |
vips-tools \ | |
# avif support | |
vips-heif | |
RUN apk add --no-cache --update \ | |
lua5.4 \ | |
lua5.4-dev \ | |
luajit \ | |
luarocks \ | |
luarocks5.4 | |
RUN ln -s $(which lua5.4) /usr/bin/lua && \ | |
ln -s $(which luarocks-5.4) /usr/bin/luarocks | |
RUN luarocks install lua-vips | |
WORKDIR /data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local vips = require 'vips'; | |
local version = { vips.version.major, vips.version.minor, vips.version.micro }; | |
print('vips version:', table.concat(version, '.')); | |
local image = vips.Image.new_from_file('image.jpg'); | |
image:write_to_file('image.avif', { Q = 50 }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment