title: How to push and pull docker images from Gitlab with access token
body: <p>I am trying to push an image to a gitlab registry with two factor authentication. It gives me this error message:</p>
  <pre><code>unauthorized: HTTP Basic: Access denied\nYou must use a personal access token with 'api' scope for Git over HTTP
  </code></pre>
  <p>I tried to use this command to login but it still says access denied:</p>
  <pre><code>docker login https://registry.gitlab.com/my_registry -u my_user_name -p my_public_key
  </code></pre>
  <p>What am I doing wrong? How can I push and pull images with the public key?</p>