FUCK musl, glibc is my friend now
This commit is contained in:
parent
e199bbbca4
commit
56ae7a27bf
2 changed files with 3 additions and 23 deletions
24
Dockerfile
24
Dockerfile
|
@ -7,7 +7,7 @@ ARG TARGETPLATFORM TARGETOS TARGETARCH BUILDOS BUILDARCH
|
||||||
|
|
||||||
RUN apk update
|
RUN apk update
|
||||||
RUN apk upgrade --available
|
RUN apk upgrade --available
|
||||||
RUN apk add alpine-sdk tar xz
|
RUN apk add alpine-sdk
|
||||||
|
|
||||||
#build bloaterbot
|
#build bloaterbot
|
||||||
COPY . .
|
COPY . .
|
||||||
|
@ -21,38 +21,18 @@ ENV COMMIT=${COMMIT}
|
||||||
|
|
||||||
RUN go build -o /tmp/build/output/bloaterbot
|
RUN go build -o /tmp/build/output/bloaterbot
|
||||||
|
|
||||||
#download ffmpeg and yt-dlp
|
|
||||||
|
|
||||||
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
|
||||||
wget "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" -O "/tmp/ffmpeg.tar.xz" && wget "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux" -O "/tmp/yt-dlp" && go build -o /tmp/build/output/bloaterbot; \
|
|
||||||
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
|
|
||||||
wget "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz" -O "/tmp/ffmpeg.tar.xz" && wget "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64" -O "/tmp/yt-dlp" && go build -o /tmp/build/output/bloaterbot; \
|
|
||||||
else \
|
|
||||||
echo "ERROR! Invalid build target" && exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RUN mkdir /tmp/ffmpeg
|
|
||||||
RUN tar -xvf /tmp/ffmpeg.tar.xz -C /tmp/ffmpeg --strip-components=1
|
|
||||||
|
|
||||||
|
|
||||||
#final container
|
#final container
|
||||||
FROM alpine:3.18
|
FROM alpine:3.18
|
||||||
|
|
||||||
#update system and install packages
|
#update system and install packages
|
||||||
RUN apk update
|
RUN apk update
|
||||||
RUN apk upgrade --available
|
RUN apk upgrade --available
|
||||||
|
RUN apk add --no-cache --virtual ffmpeg python3 py3-pip
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=build /tmp/build/output/bloaterbot /app/bloaterbot
|
COPY --from=build /tmp/build/output/bloaterbot /app/bloaterbot
|
||||||
|
|
||||||
COPY --from=build /tmp/ffmpeg/ffmpeg /usr/local/bin/ffmpeg
|
|
||||||
COPY --from=build /tmp/yt-dlp /usr/local/bin/yt-dlp
|
|
||||||
RUN chmod +x /usr/local/bin/yt-dlp /usr/local/bin/ffmpeg
|
|
||||||
|
|
||||||
|
|
||||||
COPY bloater.webp /app/bloater.webp
|
COPY bloater.webp /app/bloater.webp
|
||||||
COPY entrypoint.sh /app/entrypoint.sh
|
COPY entrypoint.sh /app/entrypoint.sh
|
||||||
|
|
2
build.sh
Normal file → Executable file
2
build.sh
Normal file → Executable file
|
@ -3,6 +3,6 @@
|
||||||
read -p 'Tag: ' tag
|
read -p 'Tag: ' tag
|
||||||
|
|
||||||
|
|
||||||
docker build --tag watn3y/bloaterbot:$(git log -1 --pretty=%h) --tag watn3y/bloaterbot:$tag --build-arg=COMMIT=$(git log -1 --pretty=%h) .
|
docker build --no-cache --progress=plain --tag bloaterbot:$(git log -1 --pretty=%h) --tag bloaterbot:$tag --build-arg=COMMIT=$(git log -1 --pretty=%h) .
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue