- Notifications
You must be signed in to change notification settings - Fork17
An example repository to demonstrate Docker support in Pants
License
pantsbuild/example-docker
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
An example repository to demonstrate Pantsbuild's experimental Docker support.
Seepantsbuild.org for much more detailed documentation.
This is only one possible way of laying out your project with Pantsbuild. Seepantsbuild.org/docs/source-roots#examplesfor some other example layouts.
Note: Pantsbuild and Pants will be used interchangebly, they refer to the same thing, the PantsBuild System.
You run Pants goals using thepants launcher binary, which will bootstrap theversion of Pants configured for this repo if necessary.
Seehere for how to install thepants binary.
Usepants --version to see the version of Pants configured for the repo (which you can also findinpants.toml).
Pants commands are calledgoals. You can get a list of goals with
pants help goalsMost goals take arguments to run on. To run on a single directory, use the directory name with:at the end. To recursively run on a directory and all its subdirectories, add:: to the end.
For example:
pants lint src/python/hello_world: src/docker::You can run on all changed files:
pants --changed-since=HEAD lintYou can run on all changed files, and any of their "dependees":
pants --changed-since=HEAD --changed-dependees=transitive testTry these out in this repo!
pants run src/docker/hello_world:pythonpants run src/docker/hello_world:shellpants list :: # All targets.pants list 'src/**/*.py' # Just targets containing Python code.pants fix lint :: # First format and fix, then lint all sources.pants count-loc '**/*'The documentation fordynamic imagetagginghas an example implementation here showcasing how it works.
DYNAMIC_TAG=$(date +%Y.%m.%d) pants package src/docker/dynamic_tags10:47:43.89 [INFO] Completed: Building docker image dynamic_tags:1.0-2022.03.1510:47:43.89 [INFO] Built docker image: dynamic_tags:1.0-2022.03.15Docker image ID: sha256:8f6922aec0de7c147862672fa2cef4bd72f51e02b5a06089b0383355410b79f2DYNAMIC_TAG=$(date +%Y.%m.%d) pants run src/docker/dynamic_tags10:47:43.89 [INFO] Completed: Building docker image dynamic_tags:1.0-2022.03.15 ____| demo | ==== \ \ ^__^ (oo)\_______ (__)\ )\/\ ||----w | || ||About
An example repository to demonstrate Docker support in Pants
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors8
Uh oh!
There was an error while loading.Please reload this page.