golang-with-upx/Dockerfile
2024-05-14 17:13:00 +08:00

17 lines
886 B
Docker

FROM golang:1.22.3-bookworm AS builder
RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list
# 移除 Debian 12 的新的源文件
RUN rm -rf /etc/apt/sources.list.d/debian.sources && apt update && apt install git -y
COPY upx /usr/bin/upx
COPY migrate /usr/bin/migrate
RUN chmod +x /usr/bin/upx && chmod +x /usr/bin/migrate
RUN upx -9 /usr/bin/migrate