添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hello Dear friends,

I am configuring CircleCI to automatically build and upload to Docker Hub multiple container of an open source library I contribute to.

Everything works fine except when I try to login on docker using the CLI.
I think that my builds have trouble to access private env vars , however I tried everything to fix it...

My configuration file is the following:

version: 2
jobs:
  build:
    working_directory: ~/build
    docker:
      - image: docker:git
    steps:
      - checkout
      - setup_remote_docker:
          reusable: true
          exclusive: true
      - run:
          name: Connect to Docker Hub
          command: |
            docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}

I obtain the following error:

#!/bin/sh -eo pipefail
docker login -u $DOCKER_USER -p $DOCKER_PASS
"docker login" requires at most 1 argument.
See 'docker login --help'.
Usage:  docker login [OPTIONS] [SERVER] [flags]
Log in to a Docker registry
Exited with code 1

The variables are of course defined:

I would like to precise, that this runs on a branch of the main project and that I don't need to run it on project forks.

The project can be found here:

  • CircleCI: https://circleci.com/gh/tensorlayer/tensorlayer/7
  • Github: https://github.com/tensorlayer/tensorlayer/tree/Docker_Test
  • Thanks a lot for the help,

    Jonathan