2020-04-28 10:08:03 -04:00
|
|
|
FROM hseeberger/scala-sbt:11.0.7_1.3.10_2.11.12
|
Support building docker images locally and without SBT (#753)
Fixes #744
Overhauls our docker release process to run releases of docker outside of SBT. This was tested through the signing process deploying SNAPSHOT images to docker hub.
All images do a git clone to pull vinyldns, and perform the build of the container based on that git clone.
- A new `build` directory contains the things to be built, for this PR only the docker images are here. Anticipate possibly pulling in other artifacts in the future.
- `build/docker` contains all of the docker setup
- `build/docker/test` contains a func test docker image that can be used to test any VinylDNS API instance
- `build/docker/test-bind9` contains our bind9 setup
- `build/docker/api` is a MySQL only API distribution
- `build/docker/portal` is a MySQL only Portal distribution
In addition, a few files are added to make the build easier:
- `build/start.sh` starts a given vinyldns version
- `build/stop.sh` stops the current running vinyldns setup
- `build/release.sh` this is the **MAIN** guy that performs the build. Lots of arguments that are useful for testing. Can provide a repository (for publishing to a docker register that is not docker hub), for building clean vs. assuming docker images. Besides building everything, also runs func tests (smoke tests) against the docker image before completing.
Added a `README.md` for others to follow along with
To test..
1. Make sure you increase your docker machine settings to 4GB (the default of 2GB failed)
2. Go to the `build` directory
3. From there, run `./release.sh -c -t 111` to only build the docker images, this should build `0.9.4-b111`
4. Start it up, run `./start.sh -v 0.9.4-b111`
5. Login to the portal at http://localhost:9001
6. When finished, run `./stop.sh` from the build directory
*If you see an error code 137 error, you need to increase your memory*
2019-10-22 19:11:28 -04:00
|
|
|
|
|
|
|
ARG BRANCH=master
|
|
|
|
ARG VINYLDNS_VERSION
|
|
|
|
|
|
|
|
RUN git clone -b ${BRANCH} --single-branch --depth 1 https://github.com/vinyldns/vinyldns.git /vinyldns
|
|
|
|
|
|
|
|
# The default jvmopts are huge, meant for running everything, use a paired down version
|
|
|
|
COPY .jvmopts /vinyldns
|
|
|
|
|
|
|
|
RUN cd /vinyldns ; sbt "set version in ThisBuild := \"${VINYLDNS_VERSION}\"" api/stage
|
|
|
|
|
2020-04-28 10:08:03 -04:00
|
|
|
FROM adoptopenjdk/openjdk11:jdk-11.0.7_10-alpine
|
Support building docker images locally and without SBT (#753)
Fixes #744
Overhauls our docker release process to run releases of docker outside of SBT. This was tested through the signing process deploying SNAPSHOT images to docker hub.
All images do a git clone to pull vinyldns, and perform the build of the container based on that git clone.
- A new `build` directory contains the things to be built, for this PR only the docker images are here. Anticipate possibly pulling in other artifacts in the future.
- `build/docker` contains all of the docker setup
- `build/docker/test` contains a func test docker image that can be used to test any VinylDNS API instance
- `build/docker/test-bind9` contains our bind9 setup
- `build/docker/api` is a MySQL only API distribution
- `build/docker/portal` is a MySQL only Portal distribution
In addition, a few files are added to make the build easier:
- `build/start.sh` starts a given vinyldns version
- `build/stop.sh` stops the current running vinyldns setup
- `build/release.sh` this is the **MAIN** guy that performs the build. Lots of arguments that are useful for testing. Can provide a repository (for publishing to a docker register that is not docker hub), for building clean vs. assuming docker images. Besides building everything, also runs func tests (smoke tests) against the docker image before completing.
Added a `README.md` for others to follow along with
To test..
1. Make sure you increase your docker machine settings to 4GB (the default of 2GB failed)
2. Go to the `build` directory
3. From there, run `./release.sh -c -t 111` to only build the docker images, this should build `0.9.4-b111`
4. Start it up, run `./start.sh -v 0.9.4-b111`
5. Login to the portal at http://localhost:9001
6. When finished, run `./stop.sh` from the build directory
*If you see an error code 137 error, you need to increase your memory*
2019-10-22 19:11:28 -04:00
|
|
|
|
|
|
|
RUN apk add --update --no-cache netcat-openbsd bash
|
|
|
|
|
|
|
|
COPY --from=builder /vinyldns/modules/api/target/universal/stage /opt/docker
|
|
|
|
|
|
|
|
# This will set the vinyldns version, make sure to have this in config... version = ${?VINYLDNS_VERSION}
|
|
|
|
ARG VINYLDNS_VERSION
|
|
|
|
ENV VINYLDNS_VERSION=$VINYLDNS_VERSION
|
|
|
|
|
|
|
|
RUN mkdir -p /opt/docker/lib_extra
|
|
|
|
|
|
|
|
# Mount the volume for config file and lib extras
|
|
|
|
# Note: These volume names are used in the build.sbt
|
|
|
|
VOLUME ["/opt/docker/lib_extra/", "/opt/docker/conf"]
|
|
|
|
|
|
|
|
EXPOSE 9000
|
|
|
|
|
|
|
|
ENTRYPOINT ["/opt/docker/bin/api"]
|