Comments (2)
Note that there is example code for building a docker image provided in the discussion of Issue #69.
from rules_spring.
This is the param doc for our internal docker image rule. I have replaced sensitive info with 'xyz' in the below:
Required arguments:
name: the name of this rule
maintainer: email address of team owning this docker image
(will be set as "maintainer" label)
srcs: list of file producing labels, to include in the docker image. For
typical Scone services, this list should include a reference to
the springboot target defined in the same BUILD file
ports: list of ports the service listens on
runtime_jdk: points to the JDK binary to copy into, and use in, the docker
image. This is a Bazel label //tools/jdk:xyz-jdk11
Optional arguments:
jarname: the executable jar to run as entrypoint. If this argument is not
specified, the jar used will be defaulted based on the specified
srcs.
java_opts: array of string arguments specified before the jar name, including
system properties. Be sure to escape regex characters (such as /)
with a backslash (\/)
main_args: array of string arguments specified at the end of the cmdline (ie
passed do your service's main method)
env: dictionary of environment variables to set in docker image
directory: the directory to copy the docker file into, defaults to /home/xyz-user
workdir: the working directory to run the entrypoint in, if unset, defaults
to the value of the 'directory' attribute
logic_snippets: bash shell scripts that are inserted into the standard entrypoint prior
to launching the service
makedirs: list of directories (paths) to create under /var/xyz_files.
/var/xyz_files is the only writable location for the xyz-user
user.
base: the base docker image to use
user: defaults to xyz-java, the default user in the default base docker
image. Should only be set if a custom base docker image is
specified
For other optional arguments that you may set, see:
https://github.com/bazelbuild/rules_docker
Some other useful arguments are:
data_path: Set to "." to preserve directories in relative paths.
For example, if you have srcs = ["src/main/blah/MyFile"], by
default MyFile will be copied to the docker image without its
leading path. With data_path = "." set, the leading path will
also be copied to the docker image
Note that we do not allow some arguments to be set, such as:
- entrypoint
- main_class
- tars
If you have a good use-case for needing to set these, please come and talk
to us.
The following environment variables are honored (see entrypoint.sh):
- JAVA_OPTS - if set, the value of ${JAVA_OPTS} is added to the java cmdline,
before the jar name.
- MAIN_ARGS - if set, the value of ${MAIN_ARGS} is added to the java cmdline,
after the jar name
from rules_spring.
Related Issues (20)
- Spring Cloud example HOT 4
- Support externalized configuration for launching with bazel run
- appjar_locator does not add the `tags` to the target HOT 5
- Multiple `springboot` targets in one package HOT 1
- Create a MODULE.bazel file to support bzlmod HOT 1
- Provide a test launcher that uses the Spring Boot launcher
- ibazel run doesn't work, beginning with v2.1.0 HOT 2
- Support testonly attribute on springboot applications
- Switch default branch name from master to main
- Make maven_install namespace (e.g. @maven) configurable in the import bundles
- Fix and improve Spring Boot rule debugging
- Provide a check_deps_maxcount enforcement and attribute
- Provide a dependency mutual exclusion check
- Provide a 'strict_usage' mode that fails the build if deprecated features or anti-patterns are used
- Rename 'checks' attributes with a consistent pattern
- Support bzlmod HOT 6
- springboot rule must honor 'neverlink' attribute on libraries
- Implement a deps_banned feature HOT 1
- Implement an 'addins' feature to copy in files to the root of the springboot jar
- Implement a include_git_properties_file attribute
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_spring.