.NET CORE 2.0 Docker Build

.net
docker
circle.yml

#1

I’ve successfully built my .NET Core application in Circle CI and can deploy the binaries. However, when I try to package the build artifacts into a Docker image, like I do for my Spring Boot project, I get the following error:

/bin/bash: line 1: docker: command not found
Exited with code 127

I am using a remote docker for the build and suspect that it is causing me these issues but I can’t figure out why exactly. Is building .NET Core docker images a supported option on Circle?

Please let me know what further information would be required to troubleshoot.


#2

Solved the problem by including docker client install as specified in examples…

 # use a primary image that already has Docker (recommended)
 # or install it during a build like we do here
      - run:
          name: Install Docker client
          command: |
            set -x
            VER="17.03.0-ce"
            curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
            tar -xz -C /tmp -f /tmp/docker-$VER.tgz
            mv /tmp/docker/* /usr/bin

#3