Skip to content

Commit 065c3fe

Browse files
committed
feat: adds docker support
1 parent fa6af66 commit 065c3fe

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

Dockerfile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM maven:3.5-jdk-8-alpine as build
2+
WORKDIR /app
3+
COPY ./ /app
4+
RUN mvn install -q && \
5+
mvn package -q && \
6+
ls /app/target/ && \
7+
MVN_VERSION=$(mvn -q \
8+
-Dexec.executable="echo" \
9+
-Dexec.args='${project.version}' \
10+
--non-recursive \
11+
org.codehaus.mojo:exec-maven-plugin:1.6.0:exec) && \
12+
mv /app/target/openapi-diff-${MVN_VERSION}-jar-with-dependencies.jar /app/openapi-diff.jar
13+
14+
FROM openjdk:8-jre-alpine
15+
WORKDIR /app
16+
COPY --from=0 /app/openapi-diff.jar /app
17+
ENTRYPOINT ["java", "-jar", "/app/openapi-diff.jar"]
18+
CMD ["--help"]

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,24 @@ try {
274274
Changed response : [200] //successful operation
275275
```
276276

277+
# Docker
278+
279+
## Build image
280+
```bash
281+
docker build -t openapi-diff .
282+
```
283+
284+
## Run an instance
285+
286+
In this example the `$(pwd)/src/test/resources` directory is mounted in the `/specs` directory of the container
287+
in readonly mode (`ro`).
288+
289+
```bash
290+
docker run -t \
291+
-v $(pwd)/src/test/resources:/specs:ro \
292+
openapi-diff /specs/path_1.yaml /specs/path_2.yaml
293+
```
294+
277295
# License
278296
openapi-diff is released under the Apache License 2.0.
279297

0 commit comments

Comments
 (0)