-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,45 @@ | ||
FROM gcr.io/distroless/base | ||
COPY manael / | ||
# Start by building the application. | ||
FROM golang:1.21.5-bookworm as build | ||
|
||
ENV LIBAOM_VERSION 3.8.0 | ||
ENV LIBWEBP_VERSION 1.3.2 | ||
|
||
RUN \ | ||
sudo apt-get update \ | ||
sudo apt-get install -y yasm \ | ||
\ | ||
mkdir -p /tmp/src \ | ||
cd /tmp/src \ | ||
wget -O libwebp.tar.gz https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${LIBWEBP_VERSION}.tar.gz \ | ||
tar -xzf libwebp.tar.gz -C /tmp/src \ | ||
rm libwebp.tar.gz \ | ||
cd /tmp/src/libwebp-${LIBWEBP_VERSION} \ | ||
./configure --prefix /tmp/libwebp \ | ||
make -j4 \ | ||
make install \ | ||
\ | ||
mkdir -p /tmp/src \ | ||
cd /tmp/src \ | ||
wget -O libaom.tar.gz https://storage.googleapis.com/aom-releases/libaom-${LIBAOM_VERSION}.tar.gz \ | ||
mkdir -p /tmp/src/libaom-${LIBAOM_VERSION} \ | ||
tar -xzf libaom.tar.gz -C /tmp/src \ | ||
rm libaom.tar.gz \ | ||
mkdir -p /tmp/src/aom_build \ | ||
cd /tmp/src/aom_build \ | ||
cmake /tmp/src/libaom-${LIBAOM_VERSION} -DCMAKE_INSTALL_PREFIX=/tmp/libaom \ | ||
make -j4 \ | ||
make install | ||
|
||
WORKDIR /go/src/manael | ||
COPY . . | ||
|
||
ENV CGO_CFLAGS -I/tmp/libwebp/include -I/tmp/libaom/include | ||
ENV CGO_LDFLAGS -L/tmp/libwebp/lib -lwebp -L/tmp/libaom/li -laom -lm | ||
|
||
RUN go mod download | ||
RUN go build -o /go/bin/manael | ||
|
||
# Now copy it into our base image. | ||
FROM gcr.io/distroless/static-debian12 | ||
COPY --from=build /go/bin/manael / | ||
CMD ["/manael"] |