It is my understanding, that in order to use private docker images, I need to do this:
version: 2 jobs: build: docker: - image: docker:stable-git working_directory: ~/app steps: - setup_remote_docker - run: docker login -u $DOCKER_USER -p $DOCKER_PASS - run: docker run -t my/image my-test.sh
It would be much nicer, if the “docker” executor section can accept credentials, like this:
version: 2 jobs: build: docker: - image: my/image - user: $DOCKER_USER - password: $DOCKER_PASSWORD working_directory: ~/app steps: - run: my-test.sh
Of course, this is just a sample implementation, and any actual implementation may probably need to be different - for example, perhaps put these credentials outside of the “image” section, so that it can be reusable, instead of having to add it to every image.