Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile error #33

Closed
po45ke95 opened this issue Jul 14, 2024 · 7 comments · Fixed by #35
Closed

Dockerfile error #33

po45ke95 opened this issue Jul 14, 2024 · 7 comments · Fixed by #35
Labels

Comments

@po45ke95
Copy link

Used the sample Dockerfile will get those error:

=> ERROR [builder 6/6] RUN xk6 build --with github.com/grafana/xk6-output-influxdb=. --output /tmp/k6 0.5s

[builder 6/6] RUN xk6 build --with github.com/grafana/xk6-output-influxdb=. --output /tmp/k6:
0.285 2024/07/14 10:42:04 [INFO] Temporary folder: /tmp/buildenv_2024-07-14-1042.3784705506
0.285 2024/07/14 10:42:04 [INFO] Initializing Go module
0.285 2024/07/14 10:42:04 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init k6
0.294 go: creating new go.mod: module k6
0.296 2024/07/14 10:42:04 [INFO] Replace github.com/grafana/xk6-output-influxdb => /go/src/go.k6.io/k6
0.296 2024/07/14 10:42:04 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod edit -replace github.com/grafana/xk6-output-influxdb=/go/src/go.k6.io/k6
0.302 2024/07/14 10:42:04 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17
0.311 go: warning: "all" matched no packages
0.314 2024/07/14 10:42:04 [INFO] Pinning versions
0.315 2024/07/14 10:42:04 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17
0.331 go: finding module for package github.com/grafana/xk6-output-influxdb
0.426 k6 imports
0.426 github.com/grafana/xk6-output-influxdb: module github.com/grafana/xk6-output-influxdb@latest found (v0.4.3, replaced by /go/src/go.k6.io/k6), but does not contain package github.com/grafana/xk6-output-influxdb
0.428 2024/07/14 10:42:04 [INFO] Cleaning up temporary folder: /tmp/buildenv_2024-07-14-1042.3784705506
0.429 2024/07/14 10:42:04 [FATAL] exit status 1


1 warning found (use --debug to expand):

  • FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)
    Dockerfile:6

4 | RUN apk --no-cache add git
5 | RUN go install go.k6.io/xk6/cmd/xk6@latest
6 | >>> RUN xk6 build --with github.com/grafana/xk6-output-influxdb=. --output /tmp/k6
7 |
8 | FROM alpine:3.17

ERROR: failed to solve: process "/bin/sh -c xk6 build --with github.com/grafana/xk6-output-influxdb=. --output /tmp/k6" did not complete successfully: exit code: 1

@codebien
Copy link
Collaborator

Hi @po45ke95,
do you get this error during the docker build command? I tried it and I don't get the same issue.

Did you change the Dockerfile?

@po45ke95
Copy link
Author

Yes @codebien I tried docker build and get those error.
This is the version of the Dockerfile that I modified and can use.

FROM golang:1.20-alpine3.17 as builder
WORKDIR $GOPATH/src/go.k6.io/k6
ADD . .
RUN apk --no-cache add git
RUN go install go.k6.io/xk6/cmd/xk6@latest
RUN go mod init k6
RUN xk6 build --with github.com/grafana/xk6-output-influxdb@latest --output /tmp/k6

FROM alpine:3.17
RUN apk add --no-cache ca-certificates && \
    adduser -D -u 12345 -g 12345 k6
COPY --from=builder /tmp/k6 /usr/bin/k6

USER 12345
WORKDIR /home/k6
ENTRYPOINT ["k6"]

@codebien
Copy link
Collaborator

This is no required, this sounds like a misconfiguration on your machine.

Please, provide a GitHub repository with a failing CI so we can debug the commands. Otherwise, this sounds like a question to open on a Docker community forum.

@marnec
Copy link

marnec commented Aug 7, 2024

same problem here and @po45ke95 solution worked, I'm on arch-linux

@po45ke95
Copy link
Author

po45ke95 commented Aug 7, 2024

I can reproduce this error on Ubuntu 24.04.
I don't think this is a CI/CD error.

@codebien
Copy link
Collaborator

codebien commented Aug 29, 2024

I've updated the Dockerfile with the most recent k6, Alpine and Go version. A new v0.5.0 version of the extension is available. Please, retry and if you continue to get the error do a new report.

@codebien codebien removed their assignment Aug 29, 2024
@vishalpatel1587
Copy link

This is still an issue with v0.5.0. @po45ke95 's solution/updated Dockerfile works for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants