title: docker-credential-ecr-login not installed or not available in PATH (Dockerfile not building with docker-compose)
body: <p>I am having a hard time building this dockerfile in docker-compose.<br />
  I am following this example here <a href="https://containrrr.dev/watchtower/private-registries/" rel="nofollow noreferrer">watchtower private-registries</a><br />
  The Dockerfile works just fine when I use <code>docker build</code>.<br />
  I also don't have a lot of experience with Docker but I have exhausted my capabilities.
  The error I keep getting on <code>docker-compose</code> is:</p>
  <pre><code>docker.credentials.errors.InitializationError: docker-credential-ecr-login not installed or not available in PATH
  [12939] Failed to execute script docker-compose
  </code></pre>
  <p>Below is the working Dockerfile.</p>
  <pre><code>FROM golang:latest
  
  ENV GOPATH /go
  ENV PATH $PATH:$GOPATH/bin
  
  ENV CGO_ENABLED 0
  ENV REPO github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login
  
  RUN go get -u $REPO
  
  RUN rm /go/bin/docker-credential-ecr-login
  
  RUN go build \
    -o /go/bin/docker-credential-ecr-login \
    /go/src/$REPO
  
  WORKDIR /go/bin/
  </code></pre>
  <p>This is my attempt at docker-compose.yml</p>
  <pre><code>version: &quot;3&quot;
  
  services:
    helper:
      build: .
      image: helper:latest
      container_name: helper
     
      volumes:
        - $HOME/.docker/config.json:/config.json
        - ./go/bin:/go/bin
      environment:
        - HOME=/
        - PATH=$PATH:/go/bin
        - REPO=github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login
        
  volumes:
    helper: {} 
  </code></pre>
  <p>Any help would be appreciated.</p>