thoas / picfit

An image resizing server written in Go
http://bit.ly/1E7rSoi
MIT License
2.14k stars 177 forks source link

Docker building 0.15.0 is broken #205

Closed mamchyts closed 5 days ago

mamchyts commented 3 weeks ago

Dockerfile:

FROM golang:1.23-bookworm as builder
LABEL stage=builder

ENV REPO=thoas/picfit

RUN apt-get update && apt-get install -y unzip \
    && wget -O /tmp/picfit.zip https://github.com/thoas/picfit/archive/refs/tags/0.15.0.zip \
    && unzip /tmp/picfit.zip -d /tmp/picfit/ \
    && mkdir -p /go/src/github.com/${REPO} \
    && cp -r /tmp/picfit/picfit-0.15.0/* /go/src/github.com/${REPO}

WORKDIR /go/src/github.com/${REPO}

RUN make docker-build-static && mv bin/picfit /picfit

###

FROM debian:buster-slim

RUN apt-get update && apt-get install -y ca-certificates

COPY --from=builder /picfit /picfit

COPY ./.docker/picfit/config.json /config.json
COPY ./.docker/picfit/config_cache.json /config_cache.json

CMD ["/picfit"]

docker build --file .docker/picfit/Dockerfile .

...
10.69 go: downloading github.com/jmespath/go-jmespath v0.3.0
11.48 go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
14.71 go: downloading github.com/googleapis/enterprise-certificate-proxy v0.2.3
14.71 go: downloading github.com/google/go-cmp v0.5.9
20.42 # github.com/chai2010/webp
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:22:9: undefined: webpGetInfo
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:26:20: undefined: webpDecodeGray
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:39:20: undefined: webpDecodeRGB
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:52:20: undefined: webpDecodeRGBA
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:68:14: undefined: webpDecodeGrayToSize
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:82:14: undefined: webpDecodeRGBToSize
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:96:14: undefined: webpDecodeRGBAToSize
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:109:7: undefined: toGrayImage
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:110:14: undefined: webpEncodeGray
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:119:14: undefined: webpEncodeRGB
20.42 /go/pkg/mod/github.com/chai2010/webp@v1.1.1/webp.go:119:14: too many errors
30.91 make[1]: Leaving directory '/go/src/github.com/thoas/picfit'
30.91 make[1]: *** [Makefile:52: build-static] Error 1
30.91 make: *** [Makefile:60: docker-build-static] Error 2
------

 1 warning found (use docker --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)
Dockerfile:14
--------------------
  12 |     WORKDIR /go/src/github.com/${REPO}
  13 |     
  14 | >>> RUN make docker-build-static && mv bin/picfit /picfit
  15 |     
  16 |     ###
--------------------
ERROR: failed to solve: process "/bin/sh -c make docker-build-static && mv bin/picfit /picfit" did not complete successfully: exit code: 2

PS. 0.14.0 - works fine PPS. => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1) - FROM and AS are both uppercase (https://docs.docker.com/reference/build-checks/from-as-casing/)

thoas commented 5 days ago

fixed in main