aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/build_defs/docker
Commit message (Collapse)AuthorAge
* Remove usages of `+` on dictsGravatar vladmos2018-01-03
| | | | | | | | | The `+` operator on dicts is deprecated and will be removed. This change makes Bazel files compatible with the new behavior. Fixes #4346. PiperOrigin-RevId: 180702882
* Raise path error for failing read in GetTarFile.Gravatar Andreas Bergmeier2017-12-21
| | | | | | Closes #4282. PiperOrigin-RevId: 179783690
* Python 3 fixes for tools/build_defs, jdk, objcGravatar Googler2017-12-19
| | | | | RELNOTES: None PiperOrigin-RevId: 179596587
* docker_pull: rely on the main repository docker_buildGravatar Damien Martin-Guillerez2017-09-22
| | | | | | | | | | | | | The legacy docker_build was removed from bazel_tools but we need to use it for our integration test so refer to the one in the main repository. Also restore the visibility, just excluding it from bazel_tools is enough and docker_pull needs to call it from other repository. Change-Id: I8a8a5781859960030ae996db95fbaf9c54ec596a PiperOrigin-RevId: 169664916
* Remove docker rules from @bazel_toolsGravatar Googler2017-09-14
| | | | | | | | | ... and lock down the visibility to only the Bazel project, please see https://github.com/bazelbuild/rules_docker instead. RELNOTES[INC]: @bazel_tools//tools/build_defs/docker:docker.bzl is no longer available, please see https://github.com/bazelbuild/rules_docker. PiperOrigin-RevId: 168650438
* Remove tests from //tools/build_defs/dockerGravatar Jeff Grafton2017-08-22
| | | | | | | | | | | | | The real docker rules are in a separate repo now; docker_build is maintained here solely for the //src/test/docker tests. The tests under //tools/build_defs/docker are incompatible with some desired changes to pkg_tar, and since they now live in a separate repo, fixing the tests here is not worth the effort, so just remove them instead. Change-Id: I642bcdb57382eea1884713ae39f5b55ad5133139 PiperOrigin-RevId: 166031190
* Rename set to depsetGravatar vladmos2017-07-27
| | | | | | The `set` constructor is obsolete and will be removed in the future. PiperOrigin-RevId: 163331591
* Hollow out docs and redirect to rules_docker.Gravatar Googler2017-05-15
| | | | PiperOrigin-RevId: 156095174
* Automated g4 rollback of commit 965617aebf4665b6a48229f32ab9a5ef7d4336c5.Gravatar Googler2017-05-05
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** rules_docker is again the default. *** Original change description *** Automated g4 rollback of commit 70d8c32e8f7b97413a4e88e219114c117deedb8b. *** Reason for rollback *** Rolling back the switch to rules_docker due to substantial performance regression in certain actions. *** Original change description *** Emit warnings when the bundled docker_build and docker_bundle rules are used. PiperOrigin-RevId: 155195712
* Automated g4 rollback of commit df3d09baf2adc2b84825a6e706f9f0c041e72425.Gravatar Googler2017-05-03
| | | | | | | | | | | | *** Reason for rollback *** Rolling back the switch to rules_docker due to substantial performance regression in certain actions. *** Original change description *** Emit warnings when the bundled docker_build and docker_bundle rules are used. PiperOrigin-RevId: 154869510
* Emit warnings when the bundled docker_build and docker_bundle rules are used.Gravatar Googler2017-05-03
| | | | PiperOrigin-RevId: 154835221
* Support top level package for docker image.Gravatar Linuxer Wang2017-04-24
| | | | | | | | Fixes #616. Closes #2807. PiperOrigin-RevId: 153714590
* Move the sha256 tool into its own directory, as it isn't specific to ↵Gravatar Googler2017-04-19
| | | | | | docker_build. PiperOrigin-RevId: 153508081
* Use sha256 prefix when tagging docker images with full IDsGravatar Jason Young2017-04-11
| | | | | | | | | | | | | | | | | | | | Newer versions of docker require 'sha256' prefix with full IDs (see https://github.com/docker/docker/issues/20972#issuecomment-193381422). Without the prefix users get the following error with newer versions of docke, e.g. 17.04.0-ce-rc1: $ docker tag 7cd4bfeb6766d1c5e5d729b7444cba3d9f97dfddfbeab90ed2e3f7147804ee8f \ docker.io/<user>/<image>:<tag> Error parsing reference: "7cd4bfeb6766d1c5e5d729b7444cba3d9f97dfddfbeab90ed2e3f7147804ee8f" is not a valid repository/tag: invalid repository name (7cd4bfeb6766d1c5e5d729b7444cba3d9f97dfddfbeab90ed2e3f7147804ee8f), cannot specify 64-byte hexadecimal strings --- I'm not sure if this is the proper solution, but it seems to fix the problem with docker version `17.04.0-ce-rc1` as well as older docker version (e.g. `1.12.0`). Alternative solutions welcome. Closes #2755. PiperOrigin-RevId: 152685896
* Add a test that a v2.2 format tarball used as a base image contains the ↵Gravatar Googler2017-03-20
| | | | | | | | appropriate ancestry. -- PiperOrigin-RevId: 150530623 MOS_MIGRATED_REVID=150530623
* Reword a commentGravatar Googler2017-03-20
| | | | | | -- PiperOrigin-RevId: 150435164 MOS_MIGRATED_REVID=150435164
* Break apart the monolithic docker.bzl into smaller pieces that logically ↵Gravatar Googler2017-03-16
| | | | | | | | group functions, constants and rules. -- PiperOrigin-RevId: 150326696 MOS_MIGRATED_REVID=150326696
* Rollback of commit 4af8f5bff567e7cad179fb803070764791353f8a.Gravatar Googler2017-03-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Fixing the test, which relied on a magic hidden feature I removed. *** Original change description *** Automated [] rollback of commit 5621a2c73337d82fe328069dbb0621e46e9e1c25. *** Reason for rollback *** This change broke bazel-docker-tests: http://ci.bazel.io/job/bazel-docker-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=docker/457/console *** Original change description *** This change adds support for a docker_bundle rule, refactoring a number of interfaces to support shared use with docker_build. This also fixes "docker load -i <bazel output>", which was broken on newer clients due to a lack of tag data in manifest.json... *** -- PiperOrigin-RevId: 149110613 MOS_MIGRATED_REVID=149110613
* Rollback of commit 5621a2c73337d82fe328069dbb0621e46e9e1c25.Gravatar Yue Gan2017-03-01
| | | | | | | | | | | | | | | | | *** Reason for rollback *** This change broke bazel-docker-tests: http://ci.bazel.io/job/bazel-docker-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=docker/457/console *** Original change description *** This change adds support for a docker_bundle rule, refactoring a number of interfaces to support shared use with docker_build. This also fixes "docker load -i <bazel output>", which was broken on newer clients due to a lack of tag data in manifest.json's RepoTags. -- PiperOrigin-RevId: 148890386 MOS_MIGRATED_REVID=148890386
* This change adds support for a docker_bundle rule, refactoring a number of ↵Gravatar Googler2017-02-28
| | | | | | | | | | interfaces to support shared use with docker_build. This also fixes "docker load -i <bazel output>", which was broken on newer clients due to a lack of tag data in manifest.json's RepoTags. -- PiperOrigin-RevId: 148767383 MOS_MIGRATED_REVID=148767383
* Fixes directory path computation in docker_build Gravatar Vlad Losev2017-02-16
| | | | | | | | | | | | | This fixes #1178. When a docker_build rule has a `files` input that is at the root of the repository, it contains no / characters, and the current version of `_short_path_dirname` returns the last character of the name instead of an empty string. Closes #2529. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/2529 PiperOrigin-RevId: 147714720 MOS_MIGRATED_REVID=147714720
* Switch to using multi-level repository names by default.Gravatar Googler2016-12-13
| | | | | | | | | | | | When these rules were originally written, I'd wanted the repository names embeded in the tarball to have a similar shape to Blaze's output trees, but unfortunately multi-level names were not yet supported. Support for multiple levels was introduced as part of the v2 registry specification, which is now all DockerHub supports, and the vast majority of clients in circulation support multi-level names. This change implements my original intention, which is to name the resulting image: bazel/{target}. To get the legacy naming system use the attribute: embed_flat_names=True. RELNOTES[INC]: docker_build: change the repository names embedded by docker_build. You can revert to the old behavior by setting legacy_repository_naming=True. -- PiperOrigin-RevId: 141886976 MOS_MIGRATED_REVID=141886976
* Change our URL to bazel.buildGravatar Damien Martin-Guillerez2016-10-28
| | | | | -- MOS_MIGRATED_REVID=137500893
* Global cleanup change.Gravatar Vladimir Moskva2016-09-07
| | | | | -- MOS_MIGRATED_REVID=132422029
* Remove dependency on gnu sedGravatar Paul Cody Johnston2016-09-07
| | | | | | | | | | BSD sed (the default on osx) does not support the -r --regexp-extended flag. Fixes #1651 Closes #1716. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/1716 MOS_MIGRATED_REVID=132350276
* Fix docker_build() run when using Docker < 1.8Gravatar Sam Guymer2016-09-07
| | | | | | | | | | | The docker version command does not have a format flag until Docker 1.8, so if it exits with a non zero exit code default to Docker version 1.5 instead of 1.10. -- Change-Id: I971bb0d8d0108e4bb6076710be5e9dfe1893e472 Reviewed-on: https://bazel-review.googlesource.com/#/c/5771 MOS_MIGRATED_REVID=132341532
* Typo fixes in markdown and javadoc as suggested by intellij typo inspection.Gravatar Googler2016-07-27
| | | | | -- MOS_MIGRATED_REVID=128476121
* Global cleanup change.Gravatar Laurent Le Brun2016-07-07
| | | | | -- MOS_MIGRATED_REVID=126687108
* Replace #!/bin/bash -eu with #!/bin/bash and "set -eu". Otherwise, the "-eu" ↵Gravatar Philipp Wollermann2016-06-21
| | | | | | | | | is not picked up when you run the scripts manually using "bash script.sh". This is also in our shell style guide: "Executables must start with #!/bin/bash and a minimum number of flags. Use set to set shell options so that calling your script as bash <script_name> does not break its functionality." -- MOS_MIGRATED_REVID=125450962
* Use valid workspace names in docker_buildGravatar Googler2016-06-15
| | | | | | | | | | Without this change, I get the following error: ERROR: /workspace/WORKSPACE:2:1: new_http_archive rule //external:docker-debian's name field must be a legal workspace name. I think this naming was made invalid in Bazel 0.1.5 -- MOS_MIGRATED_REVID=124846207
* docker_build: use a flagfile when creating the layer.Gravatar Damien Martin-Guillerez2016-06-10
| | | | | | | See https://groups.google.com/d/msgid/bazel-discuss/CAM01fBriKWxwFeb%2B-M80ryJq2Um97N9JZbr5BF7pO-xVa8cL_g%40mail.gmail.com?utm_medium=email&utm_source=footer -- MOS_MIGRATED_REVID=124543258
* Update 'docker_build' to support 1.10 image formatGravatar Sam Guymer2016-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Docker 1.10 updated the format of images moving layers to just being tarballs referenced by a configuration file. A new manifest.json file aggregates images and handles parent and tagging references. Layers and images are now identified by their sha256 hash. An image configuration file must reference all layers that belong to it by this identifier, including all layers in any parent images. Image configuration is generated the same way but now allows multiple layer sha256 hashes to be provided. The base image configuration is read to find config defaults and the layer identifiers that need to be present. Image creation now requires the layer identifier and file and can accept multiple layers. A manifest with a single entry is created that points at the image configuration, its layers and tags. If a base image is provided its layers are added to the begining of the layer section and a parent reference to the base image is added. Multiple tags can be provided which are applied when the image is loaded. The joining of partial images now consists of merging their contents minus the manifest which is concatentated together. These changes have been made in a backwards compatible way so versions of docker below 1.10 will still work as before. Fixes #1113 -- Change-Id: I0075decc48d8846ad16431948192db196ad702ee Reviewed-on: https://bazel-review.googlesource.com/3730 MOS_MIGRATED_REVID=124339578
* Wire up the |user| parameter to |docker_build|.Gravatar Googler2016-06-02
| | | | | | | | | | | The Docker USER parameter[1] specifies the system user that the contained process will run under, amoungst other things. The |docker_build| function already has an argument for this, but it was previously ignored. [1] https://docs.docker.com/engine/reference/builder/#user -- MOS_MIGRATED_REVID=123782558
* 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