decred.org/dcrdex@v1.0.5/client/Dockerfile.release (about) 1 # 2 # Build a release Docker image 3 # This file is used to build production images off of a release-vx.x branch 4 # where the site build is checked in. (This allows for faster image builds.) 5 # 6 # $ docker build -t user/dcrdex -f client/Dockerfile.release . 7 # 8 # Create docker volume to store client data 9 # $ docker volume create --name=bisonw_data 10 # 11 # Run the docker image, mapping web access port. 12 # $ docker run -d --rm -p 127.0.0.1:5758:5758 -v bisonw_data:/dex/.dexc user/dcrdex 13 # 14 15 # bisonw binary build 16 # 17 # The image below is golang:1.21.0-alpine3.18 (linux/amd64) 18 # It's pulled by the digest (immutable id) to avoid supply-chain attacks. 19 # Maintainer Note: 20 # To update to a new digest, you must first manually pull the new image: 21 # `docker pull golang:<new version>` 22 # Docker will print the digest of the new image after the pull has finished. 23 FROM golang@sha256:445f34008a77b0b98bf1821bf7ef5e37bb63cc42d22ee7c21cc17041070d134f AS gobuilder 24 WORKDIR /root/dex 25 COPY . . 26 WORKDIR /root/dex/client/cmd/bisonw/ 27 RUN CGO_ENABLED=0 GOOS=linux go build 28 WORKDIR /root/dex/client/cmd/bwctl/ 29 RUN CGO_ENABLED=0 GOOS=linux go build 30 31 # Final image 32 FROM debian:bookworm-slim 33 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates 34 WORKDIR /dex 35 ENV HOME /dex 36 RUN mkdir -p /dex/.dexc && chown 1000 /dex/.dexc 37 USER 1000 38 COPY --from=gobuilder /root/dex/client/cmd/bisonw/bisonw ./ 39 COPY --from=gobuilder /root/dex/client/cmd/bwctl/bwctl ./ 40 EXPOSE 5758 41 CMD [ "./bisonw", "--webaddr=0.0.0.0:5758" ]