golang-with-upx/Dockerfile

17 lines
886 B
Docker
Raw Permalink Normal View History

2024-05-14 09:13:00 +00:00
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
2024-03-17 08:46:02 +00:00
2024-03-17 09:22:30 +00:00
COPY upx /usr/bin/upx
COPY migrate /usr/bin/migrate
2024-03-17 09:24:56 +00:00
RUN chmod +x /usr/bin/upx && chmod +x /usr/bin/migrate
2024-03-17 09:22:30 +00:00
RUN upx -9 /usr/bin/migrate