Skip to content

Commit 17d6867

Browse files
authored
Update Dockerfiles to use a modern distro and the offical package (#658)
* Update Dockerfiles to use a modern distro and the offical package * Add comments and small optimizations * Make sure openssh-server and the proper rundir are created before starting
1 parent 3b58bfb commit 17d6867

File tree

3 files changed

+35
-56
lines changed

3 files changed

+35
-56
lines changed

docker/Dockerfile.client

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,19 @@
1-
FROM centos:8 as base
1+
FROM debian:bookworm-slim
2+
3+
# Use ADD to avoid having to install curl
4+
ADD --chmod=644 https://github.com/MisterTea/debian-et/raw/master/et.gpg /etc/apt/trusted.gpg.d/et.gpg
5+
6+
# Use a run cache to speed up rebuilding and avoid having to remove the cache when we're done
7+
RUN --mount=type=cache,mode=0755,target=/var/lib/apt/lists,sharing=locked \
8+
--mount=type=cache,mode=0755,target=/var/cache/apt,sharing=locked \
9+
rm -f /etc/apt/apt.conf.d/docker-clean && \
10+
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && \
11+
apt-get update -qq && \
12+
apt-get install -y ca-certificates && \
13+
echo "deb https://github.com/MisterTea/debian-et/raw/master/debian-source/ bookworm main" > /etc/apt/sources.list.d/et.list && \
14+
apt-get update -qq && \
15+
apt-get install -y et openssh-server
216

3-
ENV BUILD_REPOS="epel-release centos-release-scl" \
4-
BUILD_DEPS="cmake3 boost-devel libsodium-devel protobuf-devel \
5-
protobuf-compiler gflags-devel protobuf-lite-devel git \
6-
perl-IPC-Cmd perl-Data-Dumper libunwind-devel libutempter-devel \
7-
devtoolset-11 devtoolset-11-libatomic-devel rh-git227"
8-
9-
10-
WORKDIR /
11-
12-
RUN yum install -y $BUILD_REPOS && \
13-
yum install -y $BUILD_DEPS && \
14-
git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git && \
15-
cd EternalTerminal && \
16-
mkdir build && \
17-
cd build && \
18-
bash -c "scl enable devtoolset-11 rh-git227 'cmake3 ../'" && \
19-
bash -c "scl enable devtoolset-11 'make -j $(grep ^processor /proc/cpuinfo |wc -l) && make install'"
20-
21-
FROM centos:8
22-
23-
RUN yum install -y epel-release && \
24-
yum install -y protobuf-lite libsodium libatomic libunwind
25-
26-
COPY --from=base /usr/bin/etserver /usr/bin/etterminal /usr/bin/htm /usr/bin/htmd /usr/bin/
27-
COPY --from=base /EternalTerminal/etc/et.cfg /etc/et.cfg
2817
COPY --chmod=755 container-entrypoint /bin/container-entrypoint
2918

3019
ENTRYPOINT ["/bin/container-entrypoint", "client"]

docker/Dockerfile.server

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,19 @@
1-
FROM centos:8 as base
1+
FROM debian:bookworm-slim
2+
3+
# Use ADD to avoid having to install curl
4+
ADD --chmod=644 https://github.com/MisterTea/debian-et/raw/master/et.gpg /etc/apt/trusted.gpg.d/et.gpg
5+
6+
# Use a run cache to speed up rebuilding and avoid having to remove the cache when we're done
7+
RUN --mount=type=cache,mode=0755,target=/var/lib/apt/lists,sharing=locked \
8+
--mount=type=cache,mode=0755,target=/var/cache/apt,sharing=locked \
9+
rm -f /etc/apt/apt.conf.d/docker-clean && \
10+
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && \
11+
apt-get update -qq && \
12+
apt-get install -y ca-certificates && \
13+
echo "deb https://github.com/MisterTea/debian-et/raw/master/debian-source/ bookworm main" > /etc/apt/sources.list.d/et.list && \
14+
apt-get update -qq && \
15+
apt-get install -y et openssh-server
216

3-
ENV BUILD_REPOS="epel-release centos-release-scl" \
4-
BUILD_DEPS="cmake3 boost-devel libsodium-devel protobuf-devel \
5-
protobuf-compiler gflags-devel protobuf-lite-devel git \
6-
perl-IPC-Cmd perl-Data-Dumper libunwind-devel libutempter-devel \
7-
devtoolset-11 devtoolset-11-libatomic-devel rh-git227"
8-
9-
10-
WORKDIR /
11-
12-
RUN yum install -y $BUILD_REPOS && \
13-
yum install -y $BUILD_DEPS && \
14-
git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git && \
15-
cd EternalTerminal && \
16-
mkdir build && \
17-
cd build && \
18-
bash -c "scl enable devtoolset-11 rh-git227 'cmake3 ../'" && \
19-
bash -c "scl enable devtoolset-11 'make -j $(grep ^processor /proc/cpuinfo |wc -l) && make install'"
20-
21-
FROM centos:8
22-
23-
RUN yum install -y epel-release && \
24-
yum install -y protobuf-lite libsodium openssh-server libatomic libunwind
25-
26-
COPY --from=base /usr/bin/etserver /usr/bin/etterminal /usr/bin/htm /usr/bin/htmd /usr/bin/
27-
COPY --from=base /EternalTerminal/etc/et.cfg /etc/et.cfg
2817
COPY --chmod=755 container-entrypoint /bin/container-entrypoint
2918

30-
EXPOSE 2022 2222
31-
3219
ENTRYPOINT ["/bin/container-entrypoint", "server"]
33-
34-
CMD ["--cfgfile=/etc/et.cfg"]

docker/container-entrypoint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
set -x
44

55
if [ "$1" == server ]; then
6+
if [ ! -d /run/sshd ]; then
7+
mkdir /run/sshd
8+
chmod 0755 /run/sshd
9+
fi
10+
611
/usr/sbin/sshd
712
shift
813
exec etserver --logtostdout -v 1 "$@"

0 commit comments

Comments
 (0)