mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-13 20:18:52 +02:00
fix(docker): have already the converter in the docker image
This commit is contained in:
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup test environment
|
- name: Setup test environment
|
||||||
run: |
|
run: |
|
||||||
go build -tags testsetup -o test-setup ./cmd/test-setup
|
go build -tags encoder_setup -o test-setup ./cmd/test-setup
|
||||||
./test-setup
|
./test-setup
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
@@ -5,6 +5,17 @@ release:
|
|||||||
github:
|
github:
|
||||||
owner: belphemur
|
owner: belphemur
|
||||||
name: CBZOptimizer
|
name: CBZOptimizer
|
||||||
|
ids:
|
||||||
|
- cbzoptimizer
|
||||||
|
archives:
|
||||||
|
- ids:
|
||||||
|
- cbzoptimizer
|
||||||
|
formats: ["tar.zst"]
|
||||||
|
format_overrides:
|
||||||
|
- # Which GOOS to override the format for.
|
||||||
|
goos: windows
|
||||||
|
formats: ["zip"] # Plural form, multiple formats. Since: v2.6
|
||||||
|
|
||||||
changelog:
|
changelog:
|
||||||
sort: asc
|
sort: asc
|
||||||
filters:
|
filters:
|
||||||
@@ -44,6 +55,25 @@ builds:
|
|||||||
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}
|
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
|
- id: encoder-setup
|
||||||
|
main: cmd/encoder-setup/main.go
|
||||||
|
binary: encoder-setup
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm64
|
||||||
|
# ensures mod timestamp to be the commit timestamp
|
||||||
|
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||||
|
flags:
|
||||||
|
# trims path
|
||||||
|
- -trimpath
|
||||||
|
tags:
|
||||||
|
- encoder_setup
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
# config the checksum filename
|
# config the checksum filename
|
||||||
# https://goreleaser.com/customization/checksum
|
# https://goreleaser.com/customization/checksum
|
||||||
checksum:
|
checksum:
|
||||||
@@ -71,6 +101,7 @@ dockers_v2:
|
|||||||
- id: cbzoptimizer-image
|
- id: cbzoptimizer-image
|
||||||
ids:
|
ids:
|
||||||
- cbzoptimizer
|
- cbzoptimizer
|
||||||
|
- encoder-setup
|
||||||
platforms:
|
platforms:
|
||||||
- linux/amd64
|
- linux/amd64
|
||||||
- linux/arm64
|
- linux/arm64
|
||||||
@@ -90,7 +121,7 @@ dockers_v2:
|
|||||||
# all files (including the sboms) are included in the checksum, so we don't need to sign each one if we don't want to
|
# all files (including the sboms) are included in the checksum, so we don't need to sign each one if we don't want to
|
||||||
# https://goreleaser.com/customization/sign
|
# https://goreleaser.com/customization/sign
|
||||||
signs:
|
signs:
|
||||||
- cmd: cosign
|
- cmd: cosign-windows-amd64.exe
|
||||||
env:
|
env:
|
||||||
- COSIGN_EXPERIMENTAL=1
|
- COSIGN_EXPERIMENTAL=1
|
||||||
certificate: "${artifact}.pem"
|
certificate: "${artifact}.pem"
|
||||||
@@ -105,7 +136,7 @@ signs:
|
|||||||
# signs our docker image
|
# signs our docker image
|
||||||
# https://goreleaser.com/customization/docker_sign
|
# https://goreleaser.com/customization/docker_sign
|
||||||
docker_signs:
|
docker_signs:
|
||||||
- cmd: cosign
|
- cmd: cosign-windows-amd64.exe
|
||||||
env:
|
env:
|
||||||
- COSIGN_EXPERIMENTAL=1
|
- COSIGN_EXPERIMENTAL=1
|
||||||
output: true
|
output: true
|
||||||
|
10
Dockerfile
10
Dockerfile
@@ -7,7 +7,9 @@ ENV CONFIG_FOLDER=/config
|
|||||||
ENV PUID=99
|
ENV PUID=99
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends adduser && \
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||||
|
apt-get update && apt-get install -y --no-install-recommends adduser && \
|
||||||
addgroup --system users && \
|
addgroup --system users && \
|
||||||
adduser \
|
adduser \
|
||||||
--system \
|
--system \
|
||||||
@@ -21,7 +23,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends adduser && \
|
|||||||
|
|
||||||
COPY ${TARGETPLATFORM}/CBZOptimizer ${APP_PATH}
|
COPY ${TARGETPLATFORM}/CBZOptimizer ${APP_PATH}
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||||
|
--mount=type=bind,source=${TARGETPLATFORM},target=/tmp/target \
|
||||||
|
apt-get update && \
|
||||||
apt-get full-upgrade -y && \
|
apt-get full-upgrade -y && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
inotify-tools \
|
inotify-tools \
|
||||||
@@ -29,6 +34,7 @@ RUN apt-get update && \
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
bash-completion && \
|
bash-completion && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
|
/tmp/target/encoder-setup && \
|
||||||
chmod +x ${APP_PATH} && \
|
chmod +x ${APP_PATH} && \
|
||||||
${APP_PATH} completion bash > /etc/bash_completion.d/CBZOptimizer.bash
|
${APP_PATH} completion bash > /etc/bash_completion.d/CBZOptimizer.bash
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
//go:build testsetup
|
//go:build encoder_setup
|
||||||
// +build testsetup
|
// +build encoder_setup
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
Reference in New Issue
Block a user