opsgenie / oec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fails to build docker image following official guide

appier-rophy opened this issue · comments

Official Guide: https://docs.opsgenie.com/docs/oec-running#running-oec-with-docker

1. Clone the repository with git clone https://github.com/opsgenie/OEC.git
2. Run docker build . -t oec

Result:

$ docker build -t oec .
Sending build context to Docker daemon  19.24MB
Step 1/12 : FROM golang:1.11.4 as builder
 ---> dd46c1256829
Step 2/12 : ADD https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 /usr/bin/dep
Downloading [==================================================>]  8.718MB/8.718MB
 ---> Using cache
 ---> 4415ded0588e
Step 3/12 : RUN chmod +x /usr/bin/dep
 ---> Using cache
 ---> 8b5111a3de85
Step 4/12 : ADD . $GOPATH/src/github.com/opsgenie/oec
 ---> Using cache
 ---> 2c6d04c6285d
Step 5/12 : WORKDIR $GOPATH/src/github.com/opsgenie/oec/main
 ---> Using cache
 ---> 473df3eae05c
Step 6/12 : RUN export GIT_COMMIT=$(git rev-list -1 HEAD) &&     dep ensure -v &&     CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo         -ldflags "-X main.OECCommitVersion=$GIT_COMMIT -X main.OECVersion=1.0.1" -o nocgo -o /oec .
 ---> Running in 195f7a4c6ea2
could not find project Gopkg.toml, use dep init to initiate a manifest
The command '/bin/sh -c export GIT_COMMIT=$(git rev-list -1 HEAD) &&     dep ensure -v &&     CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo         -ldflags "-X main.OECCommitVersion=$GIT_COMMIT -X main.OECVersion=1.0.1" -o nocgo -o /oec .' returned a non-zero code: 1

I would recommend this repo to have tagged releases so we know which version has been tested for container builds, instead of always "master".

Same issue here following same steps with Docker version 19.03.12.

@appier-rophy @bsc8180 Looks like it might be leftover from an older build, and it uses go mod now.

I deleted/commented out every reference to the dep command, and it seems to build just fine.

Can confirm commenting out the dep commands builds container, I have still to test it though.
Commented out version attached, will do a PR after testing.
Dockerfile.txt

I've done a little testing yesterday, and had no issues with the functionality of OEC.

dep is no longer used in any release in this repo.