0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-10-31 13:09:08 +01:00
dendrite/build/docker/Dockerfile.demo-pinecone
Rhea Danzey aa8d10a62d
Pinecone test image - Explicitly select Alpine golang image (#3426)
I've noticed when trying to build the Dendrite Pinecone test image, the
build fails due to `apk` not being available:

<img width="837" alt="image"
src="https://github.com/user-attachments/assets/8b483010-a037-4499-b925-a806ae8a82cb">

Checking out the [Docker Hub](https://hub.docker.com/_/golang/) repo for
the `golang` image it looks like this can resovle to `1.22-bookworm`, so
this should ensure we get an Alpine-based image for this build.

### Pull Request Checklist

<!-- Please read
https://matrix-org.github.io/dendrite/development/contributing before
submitting your pull request -->

* [x] I have added Go unit tests or [Complement integration
tests](https://github.com/matrix-org/complement) for this PR _or_ I have
justified why this PR doesn't need tests
* [x] Pull request includes a [sign off below using a legally
identifiable
name](https://matrix-org.github.io/dendrite/development/contributing#sign-off)
_or_ I have already signed off privately

Signed-off-by: `Rhea Danzey <rdanzey@element.io>`

Signed-off-by: Rhea Danzey <rdanzey@element.io>
2024-09-18 09:16:33 +02:00

31 lines
888 B
Docker

FROM docker.io/golang:1.22-alpine AS base
#
# Needs to be separate from the main Dockerfile for OpenShift,
# as --target is not supported there.
#
RUN apk --update --no-cache add bash build-base
WORKDIR /build
COPY . /build
RUN mkdir -p bin
RUN go build -trimpath -o bin/ ./cmd/dendrite-demo-pinecone
RUN go build -trimpath -o bin/ ./cmd/create-account
RUN go build -trimpath -o bin/ ./cmd/generate-keys
FROM alpine:latest
RUN apk --update --no-cache add curl
LABEL org.opencontainers.image.title="Dendrite (Pinecone demo)"
LABEL org.opencontainers.image.description="Next-generation Matrix homeserver written in Go"
LABEL org.opencontainers.image.source="https://github.com/matrix-org/dendrite"
LABEL org.opencontainers.image.licenses="Apache-2.0"
COPY --from=base /build/bin/* /usr/bin/
VOLUME /etc/dendrite
WORKDIR /etc/dendrite
ENTRYPOINT ["/usr/bin/dendrite-demo-pinecone"]