aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/build_defs/docker
Commit message (Collapse)AuthorAge
* Add generated docs to Jekyll tree build target. Add script for bringing upGravatar David Chen2016-05-09
| | | | | | | | | | | | | | | | | | | | local instance of bazel.io site. * Add a new genrule rule that runs the new jekyll-tree.sh to do the following: * Combine the generated docs for the Build Encyclopedia and Skylark Library with the static site docs * Combine the README.md files for the Docker and Packaging rules with the Jekyll tree * Process the generated docs, replaces instances of "blaze" with "bazel", etc. * Add scripts/serve-docs.sh script that can be used to bring up a local instance of the bazel.io website. As of this patch, it is possible to construct the full Bazel.io site tree from the master branch. -- MOS_MIGRATED_REVID=121813688
* Ensure env is passed to DockerLayer actions so xzcat worksGravatar Simon Horlick2016-04-26
| | | | | | | | | This is required to fully fix #611. -- Change-Id: Iffeab2a80a02f2e1208637fe85195d0c2862e637 Reviewed-on: https://bazel-review.googlesource.com/#/c/3492 MOS_MIGRATED_REVID=120724036
* Docker: fix runfiles path when the incremental loader is called from another ↵Gravatar Damien Martin-Guillerez2016-03-01
| | | | | | | | | | Bazel binary. Also add the possibility to select the docker binary using an environment variable. -- MOS_MIGRATED_REVID=115994650
* docker: Exclude .changes files when collecting debsGravatar Benjamin Staffin2016-02-11
| | | | | | | -- Change-Id: I7badee212bd05178a30a6ff4c73c8d62258d2c1d Reviewed-on: https://bazel-review.googlesource.com/#/c/2841 MOS_MIGRATED_REVID=114330213
* Update documentation of skylark rules: correct load statementsGravatar Damien Martin-Guillerez2016-02-10
| | | | | | | Fixes #864. -- MOS_MIGRATED_REVID=114208872
* Use labels in load statementsGravatar Damien Martin-Guillerez2016-02-02
| | | | | | | | | | | | This will fix some issue with loading skylark rules from @bazel_tools. Tested with ./compile.sh all and also a project that use pkg_tar from @bazel_tools (which is broken at HEAD). -- Change-Id: Iffbb7134ef5fee497890c4d01b85084973d45ad0 Reviewed-on: https://bazel-review.googlesource.com/2800 MOS_MIGRATED_REVID=113508661
* Add the @bazel_tools prefix to docker and pkg toolingGravatar Damien Martin-Guillerez2016-01-27
| | | | | -- MOS_MIGRATED_REVID=113052852
* [docker_build] Fix required flag for create_image.pyGravatar Damien Martin-Guillerez2016-01-07
| | | | | | | | create_image.py was marking twice 'metadata' as a required flag and never 'layer'. -- MOS_MIGRATED_REVID=111600351
* Support LABEL in docker_build ruleGravatar Yuki Yugui Sonoda2015-12-21
| | | | | | | | | | | | Allows users to associate custom metadata with docker images. Discussion: https://groups.google.com/d/msg/bazel-dev/FTQVg2U3CvQ/X-8RJ01_AgAJ -- Change-Id: Ia9f6ceb1dd99aa91cf0c41f3d7afc447ab5792e5 Reviewed-on: https://bazel-review.googlesource.com/#/c/2350/ MOS_MIGRATED_REVID=110489115
* docker_build: Properly handle / as data_pathGravatar Kamal Marhubi2015-12-04
| | | | | | | | | | | | | | | | | | | | The handling in _compute_data_path would incorrectly result in an empty strip_prefix being passed to _dest_path. The outcome was all files would end up at the top of directory, instead of nested according to the repository structure. This change brings the behavior in line with the documentation, which states: > This path can be absolute from the workspace root if starting with a > `/` or relative to the rule's directory. Fixes https://github.com/bazelbuild/bazel/issues/677 -- Change-Id: Ifdab97ed0e851cf6cabc7bd3206343766861b725 Reviewed-on: https://bazel-review.googlesource.com/#/c/2480 MOS_MIGRATED_REVID=109418486
* Rollback of commit 07475c7b3812d6194602213a69e6e9f70643b32a.Gravatar Damien Martin-Guillerez2015-11-20
| | | | | | | | | | | | *** Reason for rollback *** Roll-forward with fixes: - Tests were missing for xzcat - xz output was not supported - bz2 input was missing declaration -- MOS_MIGRATED_REVID=108325435
* Rollback of commit 976211dd45215a6146e0ab312186de0eaa955a75.Gravatar Googler2015-11-18
| | | | | | | | | | | | | | | | | *** Reason for rollback *** broke Speckle and Dataflow *** Original change description *** [docker] Print a clearer message when xzcat cannot be found and is needed Also use the default shell env for docker deb files. Fixes #611. -- MOS_MIGRATED_REVID=108105646
* [docker] Print a clearer message when xzcat cannot be found and is neededGravatar Damien Martin-Guillerez2015-11-18
| | | | | | | | | Also use the default shell env for docker deb files. Fixes #611. -- MOS_MIGRATED_REVID=108035989
* Apply the docker_build directory option to tars as well as files.Gravatar Googler2015-11-17
| | | | | | | | * It enables tar packages to be placed at "/usr/local", say, and removes the need for the current workaround of repackaging the original tars. -- MOS_MIGRATED_REVID=107983091
* [docker] Fixes parsing of data_path for './'Gravatar Damien Martin-Guillerez2015-11-17
| | | | | | | Fixes #604. -- MOS_MIGRATED_REVID=107972542
* Add missing load statement in docker_build documentationGravatar Damien Martin-Guillerez2015-11-17
| | | | | | | Fixes #603. -- MOS_MIGRATED_REVID=107959662
* Allow udeb as input of docker debsGravatar Damien Martin-Guillerez2015-11-17
| | | | | | | Fixes #618. -- MOS_MIGRATED_REVID=107957576
* Fix //tools/build_defs/docker:build_testGravatar Damien Martin-Guillerez2015-11-11
| | | | | | | This is a fallout of https://bazel-review.googlesource.com/#/c/2212/ -- MOS_MIGRATED_REVID=107496707
* Tweak styling of Skylark rule READMEs to be consistent when viewed onGravatar David Chen2015-10-23
| | | | | | | external site. -- MOS_MIGRATED_REVID=106135529
* Introduce debian and tar packaging rulesGravatar Damien Martin-Guillerez2015-10-09
| | | | | | | | | | | This refactor a bit the docker rules to reuse the tarball construction. Also introduce the debian archive for the release process. RELNOTES[NEW]: Debian and tar packaging is now supported (see tools/build_defs/pkg/README.md). -- MOS_MIGRATED_REVID=105053604
* Rolling-forward with fix:Gravatar Damien Martin-Guillerez2015-10-08
| | | | | | | | | | | | | | | | | | | | | Incremental build and load of Docker layers Previously we were always tar-ing all the layers in the final image. This change does not build the full image except if required. It instead only builds the concerned layer and a loader that loads all the layers that were not previously loaded in your local registry. This is somewhat incompatible with the previous version since the full tar file is not built anymore if not explicitly requested. See https://goo.gl/P6CVyG for an extensive comparison of this change. RELNOTES: [docker_build] incremental loading is default now. Specify explicitly //package:target.tar (with the .tar extension) to obtain the full image. -- MOS_MIGRATED_REVID=104844423
* Rollback of commit fb8ee791d3b39f294bf4e083b972aee2ac6f8e27.Gravatar Damien Martin-Guillerez2015-10-07
| | | | | | | | | *** Reason for rollback *** Broke internal builds -- MOS_MIGRATED_REVID=104801084
* Incremental build and load of Docker layersGravatar Damien Martin-Guillerez2015-10-06
| | | | | | | | | | | | | | | | | | | Previously we were always tar all the layers in the final image. This change do not build the full image except if required. It instead only build the concerned layer and a loader that loads all the layer that were not previously loaded in your local registry. This is somewhat incompatible with the previous version since the full tar file is no more build if not explicitely requested. RELNOTES: [docker_build] incremental loading is default now. Specify explicitly //package:target.tar (with the .tar extension) to obtain the full image. -- Change-Id: I75c96d819f2a0f7c9444723b04b660b4939350ec Reviewed-on: https://bazel-review.googlesource.com/#/c/1820/ MOS_MIGRATED_REVID=104737560
* [Docker] archive: appends '/' at end of directoriesGravatar Damien Martin-Guillerez2015-10-02
| | | | | | | | This ensure to correctly detect duplicate for directory entries that might or might not contains ending slash. -- MOS_MIGRATED_REVID=104502468
* [Docker] add a `repository` attributeGravatar Damien Martin-Guillerez2015-10-01
| | | | | | | | This attribute specifies the default repository for the generated image. -- MOS_MIGRATED_REVID=104408398
* [docker] Enforce the executable flag to directoriesGravatar Damien Martin-Guillerez2015-09-30
| | | | | | | | | | Before this change, adding a directory might leads to non-executable directory if the mode is set to non-executable. This is never a desirable behavior. This enforce the executbale bit when the read bit is on for directory. -- MOS_MIGRATED_REVID=104276003
* [docker] Add workdir attributeGravatar Damien Martin-Guillerez2015-09-30
| | | | | | | | | | | | The workdir attribute set the initial working directory when starting the docker container. Contrary to the WORKDIR directive (see https://docs.docker.com/reference/builder/#workdir), it only affects the entry point. -- MOS_MIGRATED_REVID=104201472
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* [Docker] Correctly append ./ prefix to dotted files in archivesGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | Previously, dotted files were though of having the './' prefix. -- MOS_MIGRATED_REVID=103864015
* [Docker] Prevent duplicate entries in a layerGravatar Damien Martin-Guillerez2015-09-24
| | | | | -- MOS_MIGRATED_REVID=103745334
* [Docker] Make all files added via the files attribute executable and read-onlyGravatar Damien Martin-Guillerez2015-09-24
| | | | | | | | | | | | Also adds a `mode` attribute to docker_build so you can specify the mode you prefer. RELNOTES: [docker] docker_build now set the permission to 0555 to files added to the layer, use `mode = "0644"` to use the legacy behavior. -- MOS_MIGRATED_REVID=103743458
* [Docker] Don't replace current uid/gid by root ids for tar filesGravatar Damien Martin-Guillerez2015-09-24
| | | | | | | | | | This was not making any sense since the uid/gid in tar files should be correct not like when importing a file from the exec root. Due to that behavior, the tests were broken when using sandboxing in Bazel. -- MOS_MIGRATED_REVID=103741843
* [Docker] Take the package of the input as the data pathGravatar Damien Martin-Guillerez2015-09-24
| | | | | | | | | | | | By default all input files path are taken relatively to their declared package and no more relatively to the docker_build package. The old behavior can be restored by specifying `data_path = "."` as an attribute of the docker_build target. -- MOS_MIGRATED_REVID=103731161
* [Docker] Support for adding directories to tarballGravatar Damien Martin-Guillerez2015-09-21
| | | | | -- MOS_MIGRATED_REVID=103527154
* [Docker] Strip the identifier in top fileGravatar Damien Martin-Guillerez2015-09-21
| | | | | -- MOS_MIGRATED_REVID=103451349
* Fix small typo in exampleGravatar Roland Huß2015-09-15
| | | | | | -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/455 MOS_MIGRATED_REVID=103068929
* Add missing tools directory in the filegroup to packageGravatar Damien Martin-Guillerez2015-09-03
| | | | | | | A lot of build rules weren't shiped in the Bazel binary because of those missing filegroups -- MOS_MIGRATED_REVID=102223626
* docker_build: workaround the lack of LZMA in python 2.7Gravatar Damien Martin-Guillerez2015-08-12
| | | | | | | | | | | | | | | Some debs file actually does use the LZMA compression and reading that format requires python 3. Backports of LZMA to python 2 are using native deps which might be hard for the user to setup and our support of python 3 is not really functional (it needs 2to3 to use gflags for instance). Until we fix Bazel's python 3 support, we shell out to xzcat for supporting LZMA compressed file. Also added test for the archive library. These tests shows some wrong handling in the AR format padding, fixed. -- MOS_MIGRATED_REVID=100474498
* docker_build: fix JSON rewriting when some fields are nullGravatar Damien Martin-Guillerez2015-08-10
| | | | | | | | | Image generated by docker build might put "null" as entry value in the JSON metadata. Ignore those value when doing the deep copy to avoid error on assigning to "NoneType". -- MOS_MIGRATED_REVID=100145909
* docker_build: Fix archive's AR format alignmentGravatar Damien Martin-Guillerez2015-08-10
| | | | | -- MOS_MIGRATED_REVID=100125974
* docker_build: Fix double slashes in path resolutionGravatar Damien Martin-Guillerez2015-08-04
| | | | | | | | Before the leading slash were not striped before appending the path prefix, leading to a double slash at that point. -- MOS_MIGRATED_REVID=99807605
* Fix docker_build file path when file is generatedGravatar Damien Martin-Guillerez2015-08-04
| | | | | | | | | | | | | | | If the file is generated, by a genrule for instance, then the stripping of the prefix was incorrect because the used path was containing 'bazel-out/...' prefix. This change moved the prefix stripping to the Skylark rule so we can use "short_path". Also fix the test paths. Tested by bazel test //tools/build_defs/docker:build_test. -- Change-Id: Ia3eb98268505002bade1f6b0dd916e1a9767a530 Reviewed-on: https://bazel-review.googlesource.com/1770 MOS_MIGRATED_REVID=99710676
* Docker rules: fallback to reading the repositories file when top is absentGravatar Damien Martin-Guillerez2015-07-27
| | | | | | | | | | Docker pulled image do not have the 'top' file but does have a one entry repositories files. To enable using them as input to the docker_build rule, we read the repositories file if no 'top' file is present and use the first declared image as the parent name. -- MOS_MIGRATED_REVID=99181235
* s/the the/the/Gravatar Googler2015-07-27
| | | | | | | s/package/packages/ -- MOS_MIGRATED_REVID=99175780
* Add docker_build for building Docker image using BazelGravatar Damien Martin-Guillerez2015-07-27
docker_build is a Skylark rule that describe a docker image. You can replace Dockerfile by a docker_build to use Bazel's incrementality model. -- MOS_MIGRATED_REVID=99160762