Skip to content

Docker simple install isn't working for me out of the box #2766

@alexTheJumbo

Description

@alexTheJumbo

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

This simple Docker install isn't working for me:

FROM golang:1.16.6-buster AS build
RUN wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.45.2
RUN golangci-lint --version

The output is:

test docker build .
[+] Building 1.1s (6/6) FINISHED
 => [internal] load build definition from Dockerfile                                              0.0s
 => => transferring dockerfile: 217B                                                              0.0s
 => [internal] load .dockerignore                                                                 0.0s
 => => transferring context: 2B                                                                   0.0s
 => [internal] load metadata for docker.io/library/golang:1.16.6-buster                           0.6s
 => [1/3] FROM docker.io/library/golang:1.16.6-buster@sha256:f3923dc5a92a237db0f07a924a238a8a4a7  0.0s
 => CACHED [2/3] RUN wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/maste  0.0s
 => ERROR [3/3] RUN golangci-lint --version                                                       0.4s
------
 > [3/3] RUN golangci-lint --version:
#6 0.331 /bin/sh: 1: golangci-lint: not found
------
executor failed running [/bin/sh -c golangci-lint --version]: exit code: 127

Version of golangci-lint

Details
$ golangci-lint --version
# This is irrelevant. My question is about getting it in Docker.

Configuration file

Details
$ cat .golangci.yml
# Irrelevant

Go environment

Details
$ go version && go env
# Irrelevant

Verbose output of running

Details
$ golangci-lint cache clean
$ golangci-lint run -v
# Irrelevant

Code example or link to a public repository

Details
// Irrelevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions