diff --git a/.github/workflows/build-push-docker.yml b/.github/workflows/build-push-docker.yml index ba568ab..326a9ae 100644 --- a/.github/workflows/build-push-docker.yml +++ b/.github/workflows/build-push-docker.yml @@ -141,20 +141,20 @@ jobs: push: true tags: ${{ steps.docker_tags_server.outputs.tags }} -# - name: Build and push Docker images - [ Agent ] -# id: docker_build_agent -# # You may pin to the exact commit or the version. -# # uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 -# uses: docker/build-push-action@v3.2.0 -# with: -# context: ./ -# # Path to the Dockerfile -# file: ./agent/Dockerfile -# # List of target platforms for build -# platforms: linux/amd64,linux/arm64 -# # Always attempt to pull all referenced images -# pull: false -# # Push is a shorthand for --output=type=registry -# push: true -# tags: ${{ steps.docker_tags_agent.outputs.tags }} + - name: Build and push Docker images - [ Agent ] + id: docker_build_agent + # You may pin to the exact commit or the version. + # uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 + uses: docker/build-push-action@v3.2.0 + with: + context: ./ + # Path to the Dockerfile + file: ./agent/Dockerfile + # List of target platforms for build + platforms: linux/amd64,linux/arm64 + # Always attempt to pull all referenced images + pull: false + # Push is a shorthand for --output=type=registry + push: true + tags: ${{ steps.docker_tags_agent.outputs.tags }} diff --git a/agent/Dockerfile b/agent/Dockerfile new file mode 100644 index 0000000..530e009 --- /dev/null +++ b/agent/Dockerfile @@ -0,0 +1,23 @@ + +# Base images that the image needs to depend on +FROM icederce/eclipse-temurin-11-jre-focal + +# Set environment variables +ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms2028m -Xmx2048m" + +# Set time zone +RUN set -eux; \ + ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \ + echo $TZ > /etc/timezone \ + +# Create Folder +RUN mkdir -p /wdd + +# Define the work dir +WORKDIR /wdd + +# Copy the jar and rename it +COPY ./agent/target/agent-*.jar /wdd/agent.jar + +# When the docker container starts, run the jar +ENTRYPOINT exec java ${JAVA_OPTS} -jar /wdd/agent.jar