diff --git a/Dockerfile b/Dockerfile index 0acadaf..a73f967 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ARG TARGETPLATFORM TARGETOS TARGETARCH BUILDOS BUILDARCH RUN apk update RUN apk upgrade --available -RUN apk add alpine-sdk tar xz +RUN apk add alpine-sdk #build bloaterbot COPY . . @@ -21,38 +21,18 @@ ENV COMMIT=${COMMIT} 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 FROM alpine:3.18 #update system and install packages RUN apk update RUN apk upgrade --available +RUN apk add --no-cache --virtual ffmpeg python3 py3-pip WORKDIR /app 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 entrypoint.sh /app/entrypoint.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index 50d009d..6874f7b --- a/build.sh +++ b/build.sh @@ -3,6 +3,6 @@ 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) .