Skip to content

Commit

Permalink
chore: Update Dockerfile to use gotty instead of ttyd for running btop
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonfire1119 committed May 21, 2024
1 parent 4dd1d49 commit 0f38b2b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 19 deletions.
32 changes: 13 additions & 19 deletions btop/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
FROM debian:latest

# Install required packages for building ttyd and running btop
# Install required packages for building gotty and running btop
RUN apt-get update && apt-get install -y \
btop \
procps \
curl \
iproute2 \
git \
cmake \
g++ \
pkg-config \
libjson-c-dev \
libwebsockets-dev \
&& apt-get clean
golang-go \
&& apt-get clean \
vim

# Clone, build, and install ttyd
RUN git clone https://github.com/tsl0922/ttyd.git /tmp/ttyd && \
cd /tmp/ttyd && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install && \
# Clone, build, and install gotty
RUN git clone https://github.com/sorenisanerd/gotty.git /tmp/gotty && \
cd /tmp/gotty && \
go build && \
mv gotty /usr/local/bin/ && \
cd / && \
rm -rf /tmp/ttyd
rm -rf /tmp/gotty

# Set the terminal to support UTF-8
ENV LANG C.UTF-8

# Expose the port ttyd will run on
# Expose the port gotty will run on
EXPOSE 7681

# Start ttyd and run btop
CMD ["ttyd", "-p", "7681", "btop"]
# Start gotty and run btop
CMD ["gotty", "-p", "7681", "-w", "btop"]
35 changes: 35 additions & 0 deletions btop/Dockerfile.ttyd
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM debian:latest

# Install required packages for building ttyd and running btop
RUN apt-get update && apt-get install -y \
btop \
procps \
curl \
iproute2 \
git \
cmake \
g++ \
pkg-config \
libjson-c-dev \
libwebsockets-dev \
&& apt-get clean

# Clone, build, and install ttyd
RUN git clone https://github.com/tsl0922/ttyd.git /tmp/ttyd && \
cd /tmp/ttyd && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install && \
cd / && \
rm -rf /tmp/ttyd

# Set the terminal to support UTF-8
ENV LANG C.UTF-8

# Expose the port ttyd will run on
EXPOSE 7681

# Start ttyd and run btop
CMD ["ttyd", "-p", "7681", "-W", "btop"]

0 comments on commit 0f38b2b

Please sign in to comment.