Skip to content

Commit

Permalink
Smaller docker image (#408)
Browse files Browse the repository at this point in the history
Avoid copying tar to image, just copy extracted files.
  • Loading branch information
big-andy-coates authored Nov 21, 2023
1 parent 26cd7a9 commit 69e8ed7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions test-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ ARG APP_NAME
ARG APP_VERSION
ENV VERSION=$APP_VERSION

RUN yum update -y
RUN yum install -y tar lsof

RUN mkdir -p /opt/creek

COPY bin /bin
COPY log4j /log

COPY ${APP_NAME}-${APP_VERSION}.tar /opt/creek
COPY ${APP_NAME}-${APP_VERSION} /opt/creek/${APP_NAME}-${APP_VERSION}
WORKDIR /opt/creek
RUN tar xf ${APP_NAME}-${APP_VERSION}.tar
RUN ln -s ${APP_NAME}-${APP_VERSION} service

ENTRYPOINT ["/bin/run.sh"]
2 changes: 1 addition & 1 deletion test-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ tasks.register<Copy>("prepareDocker") {

from(
layout.projectDirectory.file("Dockerfile"),
layout.buildDirectory.file("distributions/${project.name}-${project.version}.tar"),
tarTree(layout.buildDirectory.file("distributions/${project.name}-${project.version}.tar")),
layout.projectDirectory.dir("include"),
)

Expand Down

0 comments on commit 69e8ed7

Please sign in to comment.