-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current image is >1.2gb and not at all optimized. We can utilize the python-slim base image and remove unnecessary files in the image. With these changes we cut the image size to less than half (500mb on my local machine).
- Loading branch information
1 parent
4776d42
commit f53cb76
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
FROM python:3.12 | ||
FROM python:3.12-slim | ||
|
||
EXPOSE 8126 | ||
|
||
ENV SNAPSHOT_CI=1 | ||
ENV LOG_LEVEL=INFO | ||
ENV SNAPSHOT_DIR=/snapshots | ||
|
||
RUN apt update && apt install -y git | ||
|
||
RUN mkdir -p /src | ||
WORKDIR /src | ||
COPY . /src | ||
RUN pip install /src | ||
|
||
# Cleanup | ||
RUN apt remove -y git | ||
RUN rm -rf /var/lib/apt/lists/* /root/.cache/pip /tmp/* /var/tmp/* /src | ||
|
||
CMD ["ddapm-test-agent"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
other: | ||
- | | ||
The image size has been cut roughly in half. |