java-build
1.0.0
Containerized environment for building Java based projects.
|
Convenience script for user.dockerfile.
git clone https://gitlab.com/kirkrader/java-build.git cd java-build git checkout -b yourbranch find . \( \ -name \*.dockerfile \ -o -name \* \ -o -name .gitlab-ci.yml \ \) \ -exec sed -i'.bak' 's+registry.gitlab.com/kirkrader+yourtagprefix+g' \{\} \; ./build-base-image # .custom_bashrc will be invoked after the standard .bashrc in the container # e.g. use ssh-add to enable your custom SSH keys, etc. vi docker/.custom_bashrc ./build-user-image [ password [ userid ] ]
When invoked with zero or one parameter, build-user-image will attempt to clone the current user's identity and configuration into the image being created using user.dockerfile.
When invoked with the second optional parameter, build-user-image will create an environment independent of the current user's identity.
Assumption: Individual users will invoke build-user-image for themselves without passing a second parameter. DevOps will use the two-parameter invocation to create images for special purposes, such as for use on a CI/CD server.
In either case, when build-user-image is not supplied and cannot deduce values for the following values it will prompt the user for them:
Prompt | Value |
---|---|
Password | Password for the user in the image |
Full name | Value for git config --global user.name ... |
Value for git config --global user.email ... |
When invoked with zero or one parameter, build-user-image will copy the current user's ~/.ssh
to ssh/
and ~/.m2
to m2/
. When passed a second parameter, build-user-image will assume that ssh/
and m2/
already exist and contain the desired SSH keys and Maven configuration files, respectively. There are corresponding COPY
directives in user.dockerfile. The end result is populating the specified user's SSH and Maven settings in the image.
Warning: build-user-image creates a Centos user with your personal user name, full name, email address and SSH keys. You should never push such an image to a shared repository.