File not getting created using xk6-file

I tried the same code mentioned in xk6-file. It seems to execute with no issues but no file gets created.

Following is my dockerfile:

# Build the k6 binary with the extension
FROM golang:1.18.1 as builder
RUN go install
RUN xk6 build --output /k6 --with --with
# Use the operator's base image and override the k6 binary
FROM grafana/k6:latest
COPY --from=builder /k6 /usr/bin/k6

Please note that when I build xk6-file locally using below commands, it creates file. When I use above docker file, it is not creating file.

go install
xk6 build v0.36.0 --with

@avitalique @mstoykov any guidance please on why this doesn’t work using docker

Issue is with docker volume mapping. Once it is correctly set up, I can see the file in my local.

1 Like