Build docker images - what's the recommended way

Sample in, it mentioned

      # use a primary image that already has Docker (recommended)
      ??? Then where are the sample codes?

But how? Why not give the sample codes directly and let us to guess?

After that, it gives sample to install docker each time, that’s weird document.

version: 2
      - image: golang:1.6.4-jessie   # (1)
    working_directory: /go/src/
      - checkout
      # ... steps for building/testing app ...

      - setup_remote_docker:   # (2)
          docker_layer_caching: true # (3)

      # use a primary image that already has Docker (recommended)
      # or install it during a build like we do here
      - run:
          name: Install Docker client
          command: |
            set -x
            curl -L -o /tmp/docker-$VER.tgz$VER.tgz
            tar -xz -C /tmp -f /tmp/docker-$VER.tgz
            mv /tmp/docker/* /usr/bin

It perhaps is worth pointing out that the documentation authors were not setting out to confuse you, ozbillwang. Writing documentation is really tricky to get right - if there is too much detail, then useful stuff gets lost in the noise for more experienced developers.

What the instructions are saying is that you can swap - image: golang:1.6.4-jessie for an image where Docker is already installed. Take a look on Docker Hub for docker images - in general, they would do fine.

My unpopular opinion, that I offer here a fair bit, is that CI is not easy, and it requires a solid familiarity with the (Linux) console. If you’re new to Docker, then spend a bit of time working with Docker locally - even a few days of tutorials will help a great deal.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.