nshoot/Dockerfile
2024-04-26 03:39:59 +03:30

66 lines
1.3 KiB
Docker

# Stage 1: Build stage
FROM alpine:latest as builder
# Install build dependencies
RUN apk add --no-cache \
autoconf \
build-base \
openssl-dev \
zlib-dev \
nghttp2-dev \
wget
# Download and compile curl from source
RUN wget https://curl.se/download/curl-8.7.1.tar.gz && \
tar -xzf curl-8.7.1.tar.gz && \
cd curl-8.7.1 && \
./configure --with-nghttp2=/usr --with-ssl && \
make && \
make install
# Stage 2: Final image
FROM alpine:latest
# Label the image
LABEL maintainer="rbehzadan@gmail.com"
LABEL description="Network troubleshooting and debugging tools container"
# Copy the curl binaries from builder stage
COPY --from=builder /usr/local/bin/curl /usr/local/bin/curl
COPY --from=builder /usr/local/lib /usr/local/lib
# Install runtime dependencies and other tools
RUN apk add --no-cache \
iproute2 \
net-tools \
bind-tools \
nmap \
socat \
mtr \
busybox-extras \
traceroute \
tcpdump \
iftop \
nethogs \
ncurses \
jq \
ca-certificates \
nghttp2-libs \
openssl \
libssh2 \
zlib && \
ldconfig /usr/local/lib
# Set the working directory
WORKDIR /app
# Copy from https://git.behzadan.ir/p/goecho.git
COPY build/goecho .
# Expose necessary port
EXPOSE 80
# Default command to run when starting the container
CMD ["/app/goecho", "serve", ":80"]