Skip to content

Commit a06b69f

Browse files
committed
feat: improve docker container builds
1 parent 64611f2 commit a06b69f

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
clickbench/
2+
.github/
3+
quest.*

Dockerfile

+17-9
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@ FROM golang:1.21.1-bookworm
22

33
WORKDIR /tests
44

5+
# Install all system dependencies
6+
RUN apt update && apt install -y wget jq
7+
8+
# install k6
9+
RUN gpg -k
10+
RUN gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
11+
RUN echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | tee /etc/apt/sources.list.d/k6.list
12+
RUN apt update
13+
RUN apt install k6
14+
15+
# Install flog for fake logs
16+
RUN go install github.com/mingrammer/flog
17+
18+
# Copy source files and build test binary
519
COPY . .
20+
RUN go test -c
621

7-
RUN go test -c \
8-
&& apt install wget \
9-
&& wget https://github.com/grafana/k6/releases/download/v0.46.0/k6-v0.46.0-linux-amd64.deb \
10-
&& apt install -f ./k6-v0.46.0-linux-amd64.deb \
11-
&& apt update \
12-
&& apt install -y jq \
13-
&& wget https://github.com/mingrammer/flog/releases/download/v0.4.3/flog_0.4.3_linux_amd64.tar.gz \
14-
&& tar -xvf flog_0.4.3_linux_amd64.tar.gz \
15-
&& cp flog /usr/local/bin
22+
# Make sure the shell script is executable
23+
RUN chmod +x ./main.sh
1624

1725
ENTRYPOINT ["./main.sh"]

0 commit comments

Comments
 (0)