-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.dev
More file actions
55 lines (39 loc) · 2.12 KB
/
Copy pathDockerfile.dev
File metadata and controls
55 lines (39 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ARG GOLANG_VERSION=1.25.6
FROM golang:${GOLANG_VERSION}-bookworm
ARG SERVICE_NAME SERVICE_VERSION
WORKDIR /${SERVICE_NAME}
# -- DinD
COPY --from=docker:dind-rootless --chown=nobody:nogroup /usr/local/bin/docker /usr/local/bin
# -- install 3rd-party
ARG TARGETOS TARGETARCH K6_VERSION XK6_VERSION XK6_SQL_VERSION XK6_SQL_POSTGRES_VERSION
# air
RUN --mount=target=. --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg GOOS=$TARGETOS GOARCH=$TARGETARCH go install github.com/cosmtrek/air@v1.49.0
# grpcurl
RUN --mount=target=. --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg GOOS=$TARGETOS GOARCH=$TARGETARCH go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
# k6
RUN --mount=target=. --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg GOOS=$TARGETOS GOARCH=$TARGETARCH go install go.k6.io/xk6/cmd/xk6@v${XK6_VERSION}
RUN --mount=target=. --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg GOOS=$TARGETOS GOARCH=$TARGETARCH xk6 build v${K6_VERSION} \
--with github.com/grafana/xk6-sql@v${XK6_SQL_VERSION} \
--with github.com/grafana/xk6-sql-driver-postgres@v${XK6_SQL_POSTGRES_VERSION} \
--with github.com/grafana/xk6-exec@latest \
--output /usr/bin/k6
# MinIO Client (mc) for integration tests to verify blob storage
RUN curl -fsSL https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc -o /usr/bin/mc && \
chmod +x /usr/bin/mc
# Milvus CLI for integration tests to verify vector storage
# Install Python 3 and pip if not already installed
# Also install GNU parallel for running tests in parallel
RUN apt-get update && apt-get install -y python3 python3-pip parallel ffmpeg tini && rm -rf /var/lib/apt/lists/*
# Install pymilvus
RUN pip3 install --break-system-packages "pymilvus>=2.6"
# -- set up Go
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN chown -R nobody:nogroup /go
ENV GOCACHE=/go/.cache/go-build
ENV GOENV=/go/.config/go/env
ENV SERVICE_NAME=${SERVICE_NAME}
ENV SERVICE_VERSION=${SERVICE_VERSION}
USER nobody:nogroup
ENTRYPOINT ["tini", "--", "tail", "-f", "/dev/null"]