Skip to content

Commit

Permalink
Merge pull request #10 from Rbillon59/chore/wiremock/official-image
Browse files Browse the repository at this point in the history
Chore/wiremock/official-image
  • Loading branch information
Rbillon59 authored Sep 4, 2023
2 parents 118a4ec + bd98ca7 commit f24d0dd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Push wiremock releases
on:
schedule:
- cron: '30 12 * * *'
- cron: '0 0 15 * *'
push:
workflow_dispatch:
jobs:
Expand All @@ -16,7 +16,7 @@ jobs:
- name: Set matrix for build
id: set-matrix
run: |
RELEASES=$(curl -s -H "Accept: application/vnd.github.v3+json" -X GET "https://api.github.com/repos/wiremock/wiremock/tags?per_page=20" | jq --compact-output '[ .[] | select(.name|match("[0-9].[0-9]+.[0-9]$")) | .name ]')
RELEASES=$(curl -s -H "Accept: application/vnd.github.v3+json" -X GET "https://api.github.com/repos/wiremock/wiremock-docker/tags?per_page=20" | jq --compact-output '[ .[] | select(.name|match("[0-9].[0-9]+.[0-9]$")) | .name ]')
echo "::set-output name=matrix::$RELEASES"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Set latest release for build
id: set-latest-release
run: |
RELEASES=$(curl -s -H "Accept: application/vnd.github.v3+json" -X GET "https://api.github.com/repos/wiremock/wiremock/tags?per_page=20" | jq --compact-output '[ .[] | select(.name|match("[0-9].[0-9]+.[0-9]$")) | .name ]')
RELEASES=$(curl -s -H "Accept: application/vnd.github.v3+json" -X GET "https://api.github.com/repos/wiremock/wiremock-docker/tags?per_page=20" | jq --compact-output '[ .[] | select(.name|match("[0-9].[0-9]+.[0-9]$")) | .name ]')
RELEASE=$(echo ${RELEASES} | jq -r --slurp '.[0][0]')
echo "::set-output name=release::$RELEASE"
outputs:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "2"
services:
wiremock:
image: rbillon59/wiremock-loadtest:2.30.1
image: rbillon59/wiremock-loadtest:3.0.0-1
volumes:
- ../mappings:/home/wiremock/mappings:ro
ports:
Expand Down
24 changes: 5 additions & 19 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
FROM openjdk:21-slim
ARG WIREMOCK_VERSION 3.0.0-1
FROM wiremock/wiremock:${WIREMOCK_VERSION}

ARG WIREMOCK_VERSION 2.27.2
RUN apt update && apt install wget && wget https://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-jvm/1.6.2/jolokia-jvm-1.6.2-agent.jar -O /var/wiremock/lib/jolokia-jvm.jar

RUN apt update && \
apt install -y wget && \
rm -rf /var/lib/apt/lists/*
ENV JAVA_OPTS "-Xmx1024m -Xms1024m -javaagent:/var/wiremock/lib/jolokia-jvm.jar"

RUN mkdir -p /var/wiremock/lib/ && \
wget https://search.maven.org/remotecontent?filepath=com/github/tomakehurst/wiremock-jre8-standalone/${WIREMOCK_VERSION}/wiremock-jre8-standalone-${WIREMOCK_VERSION}.jar \
-O /var/wiremock/lib/wiremock-jre8-standalone.jar && \
wget https://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-jvm/1.6.2/jolokia-jvm-1.6.2-agent.jar -O /var/wiremock/lib/jolokia-java-agent.jar && \
addgroup wiremock && \
adduser --disabled-password --gecos '' --home /home/wiremock --ingroup wiremock wiremock && \
chown --recursive wiremock:wiremock /home/wiremock


WORKDIR /tmp
USER wiremock
COPY entrypoint.sh /tmp/entrypoint.sh

ENTRYPOINT [ "./entrypoint.sh" ]
CMD ["--global-response-templating", "--no-request-journal", "--async-response-enabled", "true", "--port", "8080"]
13 changes: 0 additions & 13 deletions docker/entrypoint.sh

This file was deleted.

0 comments on commit f24d0dd

Please sign in to comment.