Skip to content

Commit

Permalink
Dockerfileの不備修正
Browse files Browse the repository at this point in the history
Signed-off-by: drumato <[email protected]>
  • Loading branch information
Drumato committed Apr 26, 2024
1 parent 1ba46fc commit ee51574
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@ WORKDIR /go/src/oyaki
COPY . /go/src/oyaki

ARG TARGETARCH="arm64"
ENV LIBWEBP_VERSION=1.3.1
ENV BASE_URL=https://storage.googleapis.com/downloads.webmproject.org/releases/webp
RUN apt-get update && apt-get install -y curl tar
RUN if [ "${TARGETARCH}" = "amd64" ]; then \
RUN apt update && apt install -y curl \
&& if [ "${TARGETARCH}" = "amd64" ]; then \
ARCH='amd64'; \
elif [ "${TARGETARCH}" = "arm64" ]; then \
ARCH='aarch64'; \
else \
echo "Unsupported arch: ${TARGETARCH}"; exit 1; \
fi && \
curl https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.1-linux-${ARCH}.tar.gz --output libwebp.tar.gz \
tar -zxf libwebp.tar.gz --strip-components=1 -C /go/bin && \
rm libwebp.tar.gz
&& tar vzxf libwebp.tar.gz \
&& mv libwebp-1.3.1-linux-${ARCH}/bin/cwebp /go/bin/

RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -ldflags "-s -w -X main.version=${OYAKI_VERSION}" -o /go/bin/oyaki

Expand Down

0 comments on commit ee51574

Please sign in to comment.