Dockerfile 517 B

1234567891011121314151617181920
  1. # Dockerfile
  2. # First image to build the binary
  3. FROM alpine as builder
  4. RUN apk --no-cache add make gcc libc-dev
  5. COPY . /src
  6. RUN mkdir /pkg && cd /src && make && make DESTDIR=/pkg install
  7. # Second minimal image to only keep the built binary
  8. FROM alpine
  9. # Copy the built files
  10. COPY --from=builder /pkg /
  11. # Copy the license as well
  12. RUN mkdir -p /usr/local/share/licenses/zstd
  13. COPY --from=builder /src/LICENSE /usr/local/share/licences/zstd/
  14. # Just run `zstd` if no other command is given
  15. CMD ["/usr/local/bin/zstd"]