You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # syntax=docker/dockerfile:latest
  2. ## build ergo binary
  3. FROM cgr.dev/chainguard/go:latest AS build-env
  4. # copy ergo source
  5. WORKDIR /go/src/github.com/ergochat/ergo
  6. COPY . .
  7. # modify default config file so that it doesn't die on IPv6
  8. # and so it can be exposed via 6667 by default
  9. RUN sed -i 's/^\(\s*\)\"127.0.0.1:6667\":.*$/\1":6667":/' /go/src/github.com/ergochat/ergo/default.yaml && \
  10. sed -i 's/^\s*\"\[::1\]:6667\":.*$//' /go/src/github.com/ergochat/ergo/default.yaml
  11. # compile
  12. RUN make install
  13. ## tmp container for collecting files
  14. FROM scratch AS tmp
  15. # collect all files
  16. COPY --from=build-env /root/go/bin/ergo \
  17. /go/src/github.com/ergochat/ergo/default.yaml \
  18. /go/src/github.com/ergochat/ergo/distrib/docker/run.sh \
  19. /ircd-bin/
  20. COPY --from=build-env /go/src/github.com/ergochat/ergo/languages /ircd-bin/languages/
  21. COPY --from=build-env /go/src/github.com/ergochat/ergo/ergo.motd /ircd/ergo.motd
  22. ## build ergo container
  23. FROM cgr.dev/chainguard/busybox:latest AS runtime
  24. # metadata
  25. LABEL maintainer="Daniel Oaks <daniel@danieloaks.net>,Daniel Thamdrup <danielthamdrup@pm.me>" \
  26. description="Ergo is a modern, experimental IRC server written in Go"
  27. # standard ports listened on
  28. EXPOSE 6667/tcp 6697/tcp
  29. # ergo itself
  30. COPY --from=tmp --chown=nonroot:nonroot / /
  31. # running volume holding config file, db, certs
  32. VOLUME /ircd
  33. WORKDIR /ircd
  34. # launch
  35. ENTRYPOINT ["/ircd-bin/run.sh"]