File tree Expand file tree Collapse file tree 2 files changed +30
-6
lines changed
content/manuals/build-cloud Expand file tree Collapse file tree 2 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,6 @@ jobs:
100100 with :
101101 driver : cloud
102102 endpoint : " ${{ vars.DOCKER_ACCOUNT }}/${{ vars.CLOUD_BUILDER_NAME }}" # for example, "acme/default"
103- install : true
104103
105104 - name : Build and push
106105 uses : docker/build-push-action@v6
@@ -111,6 +110,31 @@ jobs:
111110 outputs : ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry' }}
112111` ` `
113112
113+ The example above uses ` docker/build-push-action`, which automatically uses the
114+ builder set up by `setup-buildx-action`. If you need to use the `docker build`
115+ command directly instead, you have two options :
116+
117+ - Use `docker buildx build` instead of `docker build`
118+ - Set the `BUILDX_BUILDER` environment variable to use the cloud builder :
119+
120+ ` ` ` yaml
121+ - name: Set up Docker Buildx
122+ id: builder
123+ uses: docker/setup-buildx-action@v3
124+ with:
125+ driver: cloud
126+ endpoint: "${{ vars.DOCKER_ACCOUNT }}/${{ vars.CLOUD_BUILDER_NAME }}"
127+
128+ - name: Build
129+ run: |
130+ docker build .
131+ env:
132+ BUILDX_BUILDER: ${{ steps.builder.outputs.name }}
133+ ` ` `
134+
135+ For more information about the `BUILDX_BUILDER` environment variable, see
136+ [Build variables](/manuals/build/building/variables.md#buildx_builder).
137+
114138# ## GitLab
115139
116140` ` ` yaml
Original file line number Diff line number Diff line change @@ -45,11 +45,11 @@ Changing your default builder with `docker buildx use` only changes the default
4545builder for the ` docker buildx build ` command. The ` docker build ` command still
4646uses the ` default ` builder, unless you specify the ` --builder ` flag explicitly.
4747
48- If you use build scripts, such as ` make ` , we recommend that you update your
49- build commands from ` docker build` to ` docker buildx build ` , to avoid any
50- confusion with regards to builder selection. Alternatively, you can run `docker
51- buildx install ` to make the default ` docker build ` command behave like ` docker
52- buildx build`, without discrepancies .
48+ If you use build scripts, such as ` make ` , that use the ` docker build ` command,
49+ we recommend updating your build commands to ` docker buildx build ` . Alternatively,
50+ you can set the [ ` BUILDX_BUILDER ` environment
51+ variable ] ( /manuals/build/building/variables.md#buildx_builder ) to specify which
52+ builder ` docker build` should use .
5353
5454## Use with Docker Compose
5555
You can’t perform that action at this time.
0 commit comments