Skip to content

Commit ad4e292

Browse files
authored
Merge pull request #40 from itsjavi/feature/docker
feature: adds docker support
2 parents dc14248 + 065c3fe commit ad4e292

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-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

pom.xml

+9
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,15 @@
216216
<descriptorRef>jar-with-dependencies</descriptorRef>
217217
</descriptorRefs>
218218
</configuration>
219+
<executions>
220+
<execution>
221+
<id>make-assembly</id>
222+
<phase>package</phase>
223+
<goals>
224+
<goal>single</goal>
225+
</goals>
226+
</execution>
227+
</executions>
219228
</plugin>
220229
</plugins>
221230
</build>

0 commit comments

Comments
 (0)