Skip to content

Failing to build using docker golang container #82

Description

@Halfwalker

I usually use the docker golang container for building go projects - works quite nicely without needing golang installed locally. In this I attempted a build with

docker run --rm -v "/tmp":/output golang /bin/bash -c "go get github.com/Depado/goploader/server && go get github.com/GeertJohan/go.rice/rice && rice embed-go -i=github.com/Depado/goploader/server && go build github.com/Depado/goploader/server && cp src/github.com/Depado/goploader/server/{assets,templates} /output"

Basically duplicating what's in the README for a local build. It goes (heh) and downloads a bunch from github, but then reports this - it can't find go.mod anywhere

go: downloading github.com/Depado/goploader v0.0.0-20210411141917-6ae6953c8577
go: downloading github.com/GeertJohan/go.rice v1.0.0
go: downloading github.com/gin-gonic/gin v1.6.3
go: downloading github.com/ogier/pflag v0.0.1
go: downloading github.com/imdario/mergo v0.3.11
go: downloading github.com/asdine/storm v2.1.2+incompatible
go: downloading go.etcd.io/bbolt v1.3.5
go: downloading gopkg.in/yaml.v2 v2.3.0
go: downloading github.com/prometheus/client_golang v1.8.0
go: downloading github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5
go: downloading github.com/gin-gonic/contrib v0.0.0-20201101042839-6a891bf89f19
go: downloading github.com/fatih/color v1.10.0
go: downloading github.com/daaku/go.zipexe v1.0.1
go: downloading golang.org/x/sys v0.0.0-20201113233024-12cec1faf1ba
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading github.com/mattn/go-colorable v0.1.8
go: downloading github.com/ugorji/go v1.2.0
go: downloading github.com/golang/protobuf v1.4.3
go: downloading github.com/json-iterator/go v1.1.10
go: downloading github.com/gin-contrib/sse v0.1.0
go: downloading github.com/go-playground/validator/v10 v10.4.1
go: downloading github.com/prometheus/common v0.15.0
go: downloading github.com/prometheus/client_model v0.2.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.1.1
go: downloading github.com/prometheus/procfs v0.2.0
go: downloading github.com/ugorji/go/codec v1.2.0
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading google.golang.org/protobuf v1.25.0
go: downloading github.com/go-playground/universal-translator v0.17.0
go: downloading github.com/leodido/go-urn v1.2.0
go: downloading golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go: downloading github.com/go-playground/locales v0.13.0
go: downloading github.com/asdine/storm v1.1.0
go: downloading github.com/GeertJohan/go.rice v1.0.2
go: downloading github.com/akavel/rsrc v0.8.0
go: downloading github.com/daaku/go.zipexe v1.0.0
go: downloading github.com/GeertJohan/go.incremental v1.0.0
go: downloading github.com/jessevdk/go-flags v1.4.0
go: downloading github.com/nkovacs/streamquote v1.0.0
go: downloading github.com/valyala/fasttemplate v1.0.1
go: downloading github.com/valyala/bytebufferpool v1.0.0
error reading package: no required module provides package github.com/Depado/goploader/server: go.mod file not found in current directory or any parent directory; see 'go help modules'

Normally I like this method of building as it lends itself to ansible automation - can create a new binary in a single ansible task.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions