Skip to content

Instantly share code, notes, and snippets.

@dmitrydyomin
Last active January 14, 2022 10:45
Show Gist options
  • Save dmitrydyomin/d9a94a43e3f22e269128f1f898f324d6 to your computer and use it in GitHub Desktop.
Save dmitrydyomin/d9a94a43e3f22e269128f1f898f324d6 to your computer and use it in GitHub Desktop.
Build Imgproxy for Linux using Docker
#!/bin/bash
set -e
TAG=imgproxy-builder
docker build -t $TAG - << EOF
FROM golang:latest
RUN apt update && apt install -y libvips-dev
WORKDIR /src
RUN git clone https://github.com/imgproxy/imgproxy.git
WORKDIR /src/imgproxy
ENV CGO_LDFLAGS_ALLOW="-s|-w"
EOF
docker run --rm -v $(pwd)/output:/src/imgproxy/output $TAG go build -o output/imgproxy
docker rmi --no-prune $TAG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment