Shell commands are not available

I’m trying to execute beego commands while building the following pipeline. It throws an error at the build phase saying bee: not found. I’ve verified that command independently inside the docker image.

 base: /go
 path: src/

   image: apremalal/glide:0.5
     - GOOS=linux
     - GOARCH=amd64
     - export PATH=$PATH:$GOPATH/bin
     - bee gendocs
     - glide install
     - export CGO_ENABLED=0
     - export GOOS=linux
     - export GOARCH=amd64
     - go test -v -coverpkg=./controllers ./controllers_test -coverprofile=c.out && go tool cover -func=c.out
     - go build
     event: [ push, tag ]

This is the Dockerfile for apremalal/glide. I was able to execute bee commands locally using this image.

FROM golang:1.10-alpine

MAINTAINER Anuruddha <[email protected]>

RUN apk update && \
    apk upgrade && \
    apk add git

RUN go get
RUN go get
RUN apk add --update --no-cache \
        ca-certificates \
        git mercurial subversion bzr \
        openssh \
 && update-ca-certificates \
 # Install build dependencies
 && apk add --no-cache --virtual .build-deps \
        curl make \
 # Download and unpack Glide sources
 && curl -L -o /tmp/glide.tar.gz \
 && tar -xzf /tmp/glide.tar.gz -C /tmp \
 && mkdir -p $GOPATH/src/ \
 && mv /tmp/glide-* $GOPATH/src/ \
 && cd $GOPATH/src/ \
 # Build and install Glide executable
 && make install \
 # Install Glide license
 && mkdir -p /usr/local/share/doc/glide \
 && cp LICENSE /usr/local/share/doc/glide/ \
 # Cleanup unnecessary files
 && apk del .build-deps \
 && rm -rf /var/cache/apk/* \
           $GOPATH/src/* \


What would be the reason for bee command to not available in drone execution environment?

What would be the reason for bee command to not available in drone execution environment?

Yes, because the workspace is set to /go which means a volume is mounted at this path. This volume overrides the original folder in the image, which is why /go/bin is not available. For example, consider this:

docker volume create foo
docker run -v foo:/go apremalal/glide:0.5

I recommend moving the bee binary to /bin in your base image, so that it is not impacted when a volume is mounted on top of /go

+RUN mv /go/bin/bee /bin

You could alternatively try altering the base workspace path, but note that this could potentially lead to other complications

- base: /go
- path: src/
+ base: /go/src
+ path:

Thanks for the great explanation. Went with altering the workspace path and it worked.