Skip to content

Commit 2467347

Browse files
authored
Merge pull request #27 from movabletype/improve-mt-watcher
Refactored Dockerfile for mt-watcher.
2 parents 1b3c4c8 + 4c87369 commit 2467347

2 files changed

Lines changed: 17 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
* Introduce UPDATE_DOCKER_IMAGE environment variable.
1212
* Setting this environment variable to "no" will skip updating the Docker image during `make up`.
1313

14+
### Changed
15+
16+
* Refactored Dockerfile for mt-watcher.
17+
* Ensure that binaries with the appropriate architecture are installed even if BuildKit is disabled.
18+
* Reduced image size by using "perl:*-slim" images.
19+
1420
## [2.2.0] - 2023-02-15
1521

1622
### Added

mt/mt-watcher/Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
FROM perl:5.36
1+
FROM perl:5.36-slim
22

3-
ARG TARGETARCH
43
ARG DOCKER_VERSION=20.10.9
54

6-
## docker
75
RUN set -ex \
86
\
7+
&& apt-get update \
8+
&& apt-get install -y curl gcc \
9+
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* \
10+
## docker
911
&& mkdir /tmp/docker \
1012
&& cd /tmp/docker \
11-
&& case "${TARGETARCH}" in arm64) platform=aarch64;; *) platform=x86_64;; esac \
12-
&& curl -sL https://download.docker.com/linux/static/stable/${platform}/docker-${DOCKER_VERSION}.tgz -o docker.tgz \
13+
&& curl -sL https://download.docker.com/linux/static/stable/`arch`/docker-${DOCKER_VERSION}.tgz -o docker.tgz \
1314
&& tar zxf docker.tgz \
1415
&& mv docker/docker /usr/bin/docker \
15-
&& rm -fr /tmp/docker
16-
17-
## cpan libraries
18-
RUN set -ex \
19-
\
20-
&& cpanm Filesys::Notify::Simple Linux::Inotify2
16+
&& rm -fr /tmp/docker \
17+
&& cd \
18+
## cpan libraries
19+
&& cpanm Filesys::Notify::Simple Linux::Inotify2 \
20+
&& apt-get purge -y curl gcc

0 commit comments

Comments
 (0)