title: gitlab container registry login for error"x509: certificate signed by unknown authority" while Auto Devops
body: <p>According to <a href="https://gist.github.com/solidnerd/1bf47f85457e4f90eea541586f7290da" rel="nofollow noreferrer">https://gist.github.com/solidnerd/1bf47f85457e4f90eea541586f7290da</a>, I set a gitlab container registry on my gitlab(running on docker).I can login it with my gitlab user/password on every physical machine and all work normally. </p>
  
  <p>But when I set auto-devops according to <a href="https://docs.gitlab.com/ee/topics/autodevops/" rel="nofollow noreferrer">https://docs.gitlab.com/ee/topics/autodevops/</a>, the build log gives this error: <code>"Error response from daemon: Get https://myregistry.com:5000/v2/: x509: certificate signed by unknown authority"</code>.</p>
  
  <p>I notise that this command <code>docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"</code> in the hidden file .gitlab-ci.yml on <a href="https://gitlab.com/gitlab-org/gitlab-ci-yml/blob/master/Auto-DevOps.gitlab-ci.yml" rel="nofollow noreferrer">https://gitlab.com/gitlab-org/gitlab-ci-yml/blob/master/Auto-DevOps.gitlab-ci.yml</a>. So I add this file to my project's root direction and replace those variables  $CI_REGISTRY_USER ,$CI_REGISTRY_PASSWORD, $CI_REGISTRY . But the same error.</p>
  
  <p>Finally, I set the gitlab runner privileged valuse 'false' and succeed to login my container registry. But the privileged must be set as a valuse 'true' by the official document <a href="https://docs.gitlab.com/ee/topics/autodevops/" rel="nofollow noreferrer">https://docs.gitlab.com/ee/topics/autodevops/</a>. And another error occurred </p>
  
  <p><code>WARNING: Service runner-952743ac-project-2-concurrent-0-docker-0 probably didn't start properly.
  service runner-952743ac-project-2-concurrent-0-docker-0-wait-for-service did timeout
  2018-04-19T02:38:43.919411163Z mount: permission denied (are you root?)
  2018-04-19T02:38:43.919496576Z Could not mount /sys/kernel/security.
  2018-04-19T02:38:43.919511733Z AppArmor detection and --privileged mode might break.
  2018-04-19T02:38:43.922167862Z mount: permission denied (are you root?)</code></p>
  
  <p>Any suggestions?</p>