title: How to exit the container?
body: <p>I have created a Dockerfile with the following content: </p>
  
  <pre><code>FROM ubuntu:bionic as builder
  
  ARG DIGITALOCEAN_ACCESS_TOKEN
  
  RUN apt-get update
  RUN apt-get install -y curl
  
  WORKDIR /app
  
  RUN curl -L https://github.com/digitalocean/doctl/releases/download/v1.41.0/doctl-1.41.0-linux-amd64.tar.gz  | tar xz
  RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
  RUN curl -L https://github.com/argoproj/argo-cd/releases/download/v1.4.3/argocd-linux-amd64 -o argocd
  
  RUN chmod +x ./argocd
  RUN chmod +x ./kubectl
  
  RUN mv ./argocd /usr/local/bin/
  RUN mv ./kubectl /usr/local/bin/
  RUN mv ./doctl /usr/local/bin/
  
  
  CMD doctl auth init -t ${DIGITALOCEAN_ACCESS_TOKEN} \
      doctl account get \
      if [ $? -eq 1 ] then exit fi
  </code></pre>
  
  <p>What am I trying to achieve, when <code>doctl account get</code> return code <code>1</code>, then it should not start running container.  </p>
  
  <p>The Dockerfile above does not work as expected. What am I doing wrong?</p>