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

Added 'dep init' to Dockerfile #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nzolot
Copy link

@nzolot nzolot commented Apr 1, 2020

Update Docker file to fix next issue:

# docker build . -t oec

Sending build context to Docker daemon  19.19MB
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
 ---> 76b16e35c574
Step 3/12 : RUN chmod +x /usr/bin/dep
 ---> Using cache
 ---> 6ffed70b185a
Step 4/12 : ADD . $GOPATH/src/github.com/opsgenie/oec
 ---> 4942bdf77388
Step 5/12 : WORKDIR $GOPATH/src/github.com/opsgenie/oec/main
 ---> Running in 3e867f6aff7e
Removing intermediate container 3e867f6aff7e
 ---> a1ec961e29c4
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 73904ba08985

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```

@ispringle
Copy link

dep is old and is being phased out. Seems that the correct course of action should be to update this to not use dep and in the meantime use the appropriate Dockerfile in ./release/ instead. I was able to get this running in docker by building the binary this way and then using a modified version of the Dockerfile in the root of this repo:

FROM alpine:latest
RUN addgroup -S opsgenie && \
    adduser -S opsgenie -G opsgenie
COPY  /path/to/opsgenie/oec/release/oec-builder/oec-packages-linux/OpsgenieEdgeConnector /opt/oec
RUN mkdir -p /var/log/opsgenie && \
    chown -R opsgenie:opsgenie /var/log/opsgenie && \
    chown -R opsgenie:opsgenie /opt/oec && \
    apk update && \
    apk add --no-cache git ca-certificates && \
    update-ca-certificates
USER opsgenie
ENTRYPOINT ["/opt/oec"]

Then you can continue using the documentation. But I do agree with the spirit of this PR, this needs to be updated.

@DPatrickBoyd
Copy link

this is also an issue with me using the Dockerfile provided. adding the dep init still ended with a non-zero return

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

Successfully merging this pull request may close these issues.

3 participants