I built the docker image using following Dockerfile with Drone build server.
FROM centurylink/ca-certs
WORKDIR /app
ADD VERSION .
ADD conf/ conf/
ADD resources/ resources/
ADD app app
# Expose the application on port 8080
EXPOSE 80
ENTRYPOINT ["./app"]
However it results in the exception standard_init_linux.go:178: exec user process caused "no such file or directory"
Docker host is MacOS. And I'm trying to execute this image in Amazon EC2 linux instance.
Following is the drone build script. (.drone.yml
)
workspace:
base: /go
path: src/github.com/me/app
pipeline:
build:
image: instrumentisto/glide
commands:
- glide install
- export GOOS=linux
- export GOARCH=amd64
- go build
- go test -v
when:
event: [ push, tag ]
publish:
image: plugins/ecr
repo: 111.dkr.ecr.eu-central-1.amazonaws.com/app
registry: 111.dkr.ecr.eu-central-1.amazonaws.com
dockerfile: Dockerfile
tag: ${DRONE_TAG}
default_tags: false
default_branch: development
secrets: [ ecr_access_key, ecr_secret_key, ecr_region ]
when:
event: tag
status: success
ref: refs/tags/v1*
I've came across similar issues in SO where they suggest to add a shebang line in the script. However in my case the entry point is not a script rather a golang executable.