mirror of
https://github.com/idanoo/autobrr
synced 2025-07-22 16:29:12 +00:00
parent
80426e4773
commit
e603b262f7
2 changed files with 20 additions and 11 deletions
|
@ -26,24 +26,24 @@ export GOARCH=$TARGETARCH; \
|
||||||
[[ "$GOARCH" == "arm" ]] && [[ "$TARGETVARIANT" == "v6" ]] && export GOARM=6; \
|
[[ "$GOARCH" == "arm" ]] && [[ "$TARGETVARIANT" == "v6" ]] && export GOARM=6; \
|
||||||
[[ "$GOARCH" == "arm" ]] && [[ "$TARGETVARIANT" == "v7" ]] && export GOARM=7; \
|
[[ "$GOARCH" == "arm" ]] && [[ "$TARGETVARIANT" == "v7" ]] && export GOARM=7; \
|
||||||
echo $GOARCH $GOOS $GOARM$GOAMD64; \
|
echo $GOARCH $GOOS $GOARM$GOAMD64; \
|
||||||
go build -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o /out/bin/autobrr cmd/autobrr/main.go && \
|
go build -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o /out/bin/autobrr.exe cmd/autobrr/main.go && \
|
||||||
go build -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o /out/bin/autobrrctl cmd/autobrrctl/main.go
|
go build -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${BUILDTIME}" -o /out/bin/autobrrctl.exe cmd/autobrrctl/main.go
|
||||||
|
|
||||||
# build runner
|
# build runner
|
||||||
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 AS runner
|
FROM mcr.microsoft.com/windows/nanoserver:ltsc2019 AS runner
|
||||||
|
|
||||||
LABEL org.opencontainers.image.source="https://github.com/autobrr/autobrr"
|
LABEL org.opencontainers.image.source="https://github.com/autobrr/autobrr"
|
||||||
LABEL org.opencontainers.image.licenses="GPL-2.0-or-later"
|
LABEL org.opencontainers.image.licenses="GPL-2.0-or-later"
|
||||||
LABEL org.opencontainers.image.base.name="mcr.microsoft.com/windows/nanoserver:ltsc2022"
|
LABEL org.opencontainers.image.base.name="mcr.microsoft.com/windows/nanoserver:ltsc2019"
|
||||||
|
|
||||||
ENV HOME="/config" \
|
ENV HOME="C:\config" \
|
||||||
XDG_CONFIG_HOME="/config" \
|
XDG_CONFIG_HOME="C:\config" \
|
||||||
XDG_DATA_HOME="/config"
|
XDG_DATA_HOME="C:\config"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR "C:\\app"
|
||||||
VOLUME /config
|
VOLUME "C:\\config"
|
||||||
EXPOSE 7474
|
EXPOSE 7474
|
||||||
|
|
||||||
COPY --link --from=app-builder /out/bin/autobrr* /
|
COPY --from=app-builder /out/bin/autobrr* /
|
||||||
|
|
||||||
ENTRYPOINT ["/autobrr", "--config", "/config"]
|
ENTRYPOINT C:\autobrr.exe --config C:\config
|
||||||
|
|
|
@ -130,6 +130,15 @@ func (c *AppConfig) writeConfig(configPath string, configFile string) error {
|
||||||
// but there's a good chance this is an isolated namespace
|
// but there's a good chance this is an isolated namespace
|
||||||
// or a container.
|
// or a container.
|
||||||
host = "0.0.0.0"
|
host = "0.0.0.0"
|
||||||
|
} else if user := os.Getenv("USERNAME"); user == "ContainerAdministrator" || user == "ContainerUser" {
|
||||||
|
/* this is the correct code below, but golang helpfully Panics when it can't find netapi32.dll
|
||||||
|
the issue was first reported 7 years ago, but is fixed in go 1.24 where the below code works.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
u, err := user.Current(); err == nil && u != nil &&
|
||||||
|
(u.Name == "ContainerAdministrator" || u.Name == "ContainerUser") {
|
||||||
|
// Windows conatiners run containers as ContainerAdministrator by default */
|
||||||
|
host = "0.0.0.0"
|
||||||
} else if pd, _ := os.Open("/proc/1/cgroup"); pd != nil {
|
} else if pd, _ := os.Open("/proc/1/cgroup"); pd != nil {
|
||||||
defer pd.Close()
|
defer pd.Close()
|
||||||
b := make([]byte, 4096)
|
b := make([]byte, 4096)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue