Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ end
gem 'rouge', '3.27.0'

gem 'archive-zip', '0.12.0'
gem 'front_matter_parser', '1.0.1'
gem 'html-proofer', '3.19.4'
gem 'mdl', '0.11.0'
gem 'octopress-hooks', '2.6.2'
Expand Down
14 changes: 8 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ GEM
eventmachine (1.2.7)
ffi (1.15.5)
forwardable-extended (2.6.0)
front_matter_parser (1.0.1)
html-proofer (3.19.4)
addressable (~> 2.3)
mercenary (~> 0.3)
Expand All @@ -26,7 +27,7 @@ GEM
typhoeus (~> 1.3)
yell (~> 2.0)
http_parser.rb (0.8.0)
i18n (1.10.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
io-like (0.3.1)
jekyll (4.2.2)
Expand Down Expand Up @@ -71,16 +72,16 @@ GEM
mercenary (0.4.0)
mini_portile2 (2.8.0)
mixlib-cli (2.1.8)
mixlib-config (3.0.9)
mixlib-config (3.0.27)
tomlrb
mixlib-shellout (3.2.7)
chef-utils
nokogiri (1.13.6)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.6-aarch64-linux)
nokogiri (1.13.8-aarch64-linux)
racc (~> 1.4)
nokogiri (1.13.6-x86_64-linux)
nokogiri (1.13.8-x86_64-linux)
racc (~> 1.4)
octopress-hooks (2.6.2)
jekyll (>= 2.0)
Expand All @@ -101,7 +102,7 @@ GEM
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tomlrb (2.0.1)
tomlrb (2.0.3)
typhoeus (1.4.0)
ethon (>= 0.9.0)
unicode-display_width (1.8.0)
Expand All @@ -114,6 +115,7 @@ PLATFORMS

DEPENDENCIES
archive-zip (= 0.12.0)
front_matter_parser (= 1.0.1)
html-proofer (= 3.19.4)
jekyll (= 4.2.2)
jekyll-redirect-from
Expand Down
10 changes: 9 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ fetch-remote:
- "!docs/README.md" # readme to make things nice in the compose-cli repo, but meaningless here
- "!docs/architecture.md" # Compose-CLI architecture, unrelated to cloud integration

- repo: "https://github.com/docker/buildx"
default_branch: "master"
ref: "master"
paths:
- dest: "build/bake"
src:
- "docs/guides/bake/**"

- repo: "https://github.com/distribution/distribution"
default_branch: "main"
ref: "release/2.7"
Expand All @@ -179,6 +187,6 @@ fetch-remote:
default_branch: "master"
ref: "master"
paths:
- dest: "_includes/dockerfile/reference.md"
- dest: "engine/reference/builder.md"
src:
- "frontend/dockerfile/docs/reference.md"
16 changes: 15 additions & 1 deletion _data/toc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,21 @@ manuals:
- path: /build/buildx/multiple-builders/
title: Using multiple builders
- path: /build/buildx/multiplatform-images/
title: Building multi-platform images
title: Building multi-platform images
- sectiontitle: Bake
section:
- path: /build/bake/
title: Bake overview
- path: /build/bake/file-definition/
title: File definition
- path: /build/bake/configuring-build/
title: Configuring builds
- path: /build/bake/hcl-funcs/
title: User defined HCL functions
- path: /build/bake/build-contexts/
title: Build contexts and linking targets
- path: /build/bake/compose-file/
title: Building from Compose file
- sectiontitle: Docker Compose
section:
- path: /compose/
Expand Down
24 changes: 23 additions & 1 deletion _plugins/fetch_remote.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'archive/zip'
require 'front_matter_parser'
require 'jekyll'
require 'json'
require 'octopress-hooks'
Expand Down Expand Up @@ -33,6 +34,16 @@ def self.copy(src, dest)
end
end

def self.resolve_line_numbers(first, last)
if first.nil? && last.nil?
first = 0
last = -1
elsif last.nil?
last = first
end
[first.to_i, last.to_i]
end

def pre_read(site)
beginning_time = Time.now
puts "Starting plugin fetch_remote.rb..."
Expand Down Expand Up @@ -77,7 +88,18 @@ def pre_read(site)
file_clean = ent.path.delete_prefix(ztmpdir).split("/").drop(2).join("/")
destent = FileUtils::Entry_.new(d, ent.rel, false)
puts " #{file_clean} => #{destent.path}"
ent.copy destent.path

if File.file?(destent.path)
fmp = FrontMatterParser::Parser.parse_file(destent.path)
if fmp['fetch_remote'].nil?
raise "Local file #{destent.path} already exists"
end
line_start, line_end = FetchRemote.resolve_line_numbers(fmp['fetch_remote'].kind_of?(Hash) ? fmp['fetch_remote']['line_start'] : nil, fmp['fetch_remote'].kind_of?(Hash) ? fmp['fetch_remote']['line_end'] : nil)
lines = File.readlines(ent.path)[line_start..line_end]
File.open(destent.path, "a") { |fow| fow.puts lines.join }
else
ent.copy destent.path
end

next unless File.file?(ent.path) && File.extname(ent.path) == ".md"
# set edit and issue url and remote info for markdown files in site config defaults
Expand Down
54 changes: 0 additions & 54 deletions _plugins/include_remote.rb

This file was deleted.

7 changes: 7 additions & 0 deletions build/bake/build-contexts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Defining additional build contexts and linking targets"
keywords: build, buildx, bake, buildkit, hcl
fetch_remote:
line_start: 2
line_end: -1
---
7 changes: 7 additions & 0 deletions build/bake/compose-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Building from Compose file"
keywords: build, buildx, bake, buildkit, compose
fetch_remote:
line_start: 2
line_end: -1
---
7 changes: 7 additions & 0 deletions build/bake/configuring-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Configuring builds"
keywords: build, buildx, bake, buildkit, hcl, json
fetch_remote:
line_start: 2
line_end: -1
---
7 changes: 7 additions & 0 deletions build/bake/file-definition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Bake file definition"
keywords: build, buildx, bake, buildkit, hcl, json, compose
fetch_remote:
line_start: 2
line_end: -1
---
7 changes: 7 additions & 0 deletions build/bake/hcl-funcs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "User defined HCL functions"
keywords: build, buildx, bake, buildkit, hcl
fetch_remote:
line_start: 2
line_end: -1
---
7 changes: 7 additions & 0 deletions build/bake/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "High-level build options with Bake"
keywords: build, buildx, bake, buildkit, hcl, json, compose
fetch_remote:
line_start: 2
line_end: -1
---
24 changes: 3 additions & 21 deletions build/buildx/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,7 @@ other drivers, the method for outputting an image needs to be selected
with `--output`.


## High-level build options
## High-level build options with Bake

Buildx also aims to provide support for high-level build concepts that go beyond
invoking a single build command.

BuildKit efficiently handles multiple concurrent build requests and de-duplicating
work. The build commands can be combined with general-purpose command runners
(for example, `make`). However, these tools generally invoke builds in sequence
and therefore cannot leverage the full potential of BuildKit parallelization,
or combine BuildKit’s output for the user. For this use case, we have added a
command called [`docker buildx bake`](../../engine/reference/commandline/buildx_bake.md).

The `bake` command supports building images from compose files, similar to
[`docker-compose build`](../../engine/reference/commandline/compose_build.md),
but allowing all the services to be built concurrently as part of a single
request.

There is also support for custom build rules from HCL/JSON files allowing
better code reuse and different target groups. The design of bake is in very
early stages, and we are looking for feedback from users. Let us know your
feedback by creating an issue in the [Docker Buildx](https://github.com/docker/buildx/issues){:target="_blank" rel="noopener" class="_"}
GitHub repository.
Check out our guide about [Bake](../bake/index.md) to get started with the
[`docker buildx bake` command](../../engine/reference/commandline/buildx_bake.md).
3 changes: 1 addition & 2 deletions build/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ Automate your image builds to run in GitHub actions using the official docker bu

* **Orchestrating builds across complex projects together**
Connect your builds together and easily parameterize your images using buildx bake.
<!--replace when Bake content is onboarded -->
See [High-level build options](buildx/index.md/#high-level-build-options)
See [High-level build options with Bake](bake/index.md).

### Customizing your Builds

Expand Down
2 changes: 1 addition & 1 deletion compose/compose-file/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,4 @@ build:
## Implementations

* [docker-compose](https://docs.docker.com/compose)
* [buildX bake](https://docs.docker.com/buildx/working-with-buildx/)
* [buildx bake](../../build/bake/index.md)
5 changes: 3 additions & 2 deletions engine/reference/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ keywords: build, dockerfile, reference
toc_max: 3
redirect_from:
- /reference/builder/
fetch_remote:
line_start: 2
line_end: -1
---

{% include_remote dockerfile/reference.md 2 -1 -%}