-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple Dockerfile sandbox & docs (#294)
* add dockerfile * More docs * docker * more cleanup * fix mkdir command Co-authored-by: Bentley Breithaupt <[email protected]> Co-authored-by: Bentley Breithaupt <[email protected]>
- Loading branch information
Showing
3 changed files
with
54 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Use base image: https://github.com/keeganwitt/docker-gradle | ||
FROM gradle:jdk11 | ||
|
||
RUN mkdir -p /app/atlas-checks | ||
COPY . /app/atlas-checks | ||
|
||
ENTRYPOINT ["/app/atlas-checks/gradlew"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Development - Docker | ||
|
||
Use the [Dockerfile](/Dockerfile) to build a simple Docker container for development. The base image is derived from | ||
[docker-gradle](https://github.com/keeganwitt/docker-gradle), a simple image that contains | ||
both gradle (v6.4) and [adoptopenjdk11](https://github.com/AdoptOpenJDK/openjdk-docker). | ||
|
||
## Installation and setup | ||
Create docker image (in atlas-checks root). | ||
```bash | ||
docker build --rm --tag checks . | ||
``` | ||
|
||
Create a docker container from the "checks" image. By default, the container exposes the gradle | ||
wrapper (`gradlew`) script that invokes project's latest version of gradle. With this, you can | ||
run the following commands: `run, build, buildCheck` | ||
```bash | ||
docker run [image name] [gradle command] | ||
``` | ||
|
||
|
||
## Examples | ||
Build the project (runs unit and integration tests). | ||
``` | ||
docker run checks clean build | ||
``` | ||
|
||
Run the default gradle run command. This will download a example pbf from geofabrik, execute the | ||
atlas checks specified in the default configuration, and save the results to | ||
`/app/atlas-checks/build/example/flag` | ||
|
||
``` | ||
docker run checks run | ||
``` | ||
|
||
Run the gradle run command using your local directory as the source. This is useful for local | ||
development -- as changes to to the source code will be reflected when executing the command. Also, | ||
outputs will be stored on your local machine. | ||
```bash | ||
docker run --mount type=bind,src=/path/to/local/atlas-checks,dst=/app/atlas-checks checks run \ | ||
-Pchecks.local.countries=AIA \ | ||
-Pchecks.local.checkFilter=SpikyBuildingCheck | ||
``` |