title: BitBucket Pipeline cannot find container after ssh into DigitalOcean Droplet
body: <p>Here is my code</p>
  
  <pre><code>- step:
      name: SSH to Digital Ocean and update docker image
      script:
        - head ~/.ssh/config
        - ssh -i ~/.ssh/config root@XXX.XXX.XXX.XXX
        - docker ps
        - docker rm -f gvcontainer
        - docker image rm -f myrepo/myimage:tag
        - docker pull myrepo/myimage:tag
        - docker run --name gvcontainer -p 12345:80 -d=true --restart=always myrepo/myimage:tag
      services:
        - docker
  </code></pre>
  
  <p>Here I can see that the Pipeline ssh into my DO droplet successfully, but for some reason(I guess, it was too quick to type the "docker ps". it should to wait a few seconds, but I just don't know how to postpone the operation) it could not find the container.</p>
  
  <p>So I manually ssh into my droplet and checked, the gvcontainer is there.</p>
  
  <p><a href="https://i.stack.imgur.com/Quj1H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Quj1H.png" alt="enter image description here"></a></p>
  
  <p>Please enlighten me with any possible reasons.
  Thanks</p>