From 57919f27b52fd243070a20afec5b8eb8ec35ec57 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Thu, 25 Jul 2024 14:23:49 +0200 Subject: [PATCH] remove docker --- Dockerfile.magneticod | 22 ------------------- Dockerfile.magneticow | 26 ----------------------- Makefile | 49 ++++++++++++++++--------------------------- README.md | 22 +------------------ docker-compose.yml | 19 ----------------- 5 files changed, 19 insertions(+), 119 deletions(-) delete mode 100644 Dockerfile.magneticod delete mode 100644 Dockerfile.magneticow delete mode 100644 docker-compose.yml diff --git a/Dockerfile.magneticod b/Dockerfile.magneticod deleted file mode 100644 index 4ed1ca3..0000000 --- a/Dockerfile.magneticod +++ /dev/null @@ -1,22 +0,0 @@ -FROM golang:1.19-alpine AS build -WORKDIR /magnetico - -RUN apk add --no-cache build-base curl git - -ADD ./Makefile /magnetico/ -ADD ./pkg /magnetico/pkg -ADD ./go.mod /magnetico/go.mod -ADD ./go.sum /magnetico/go.sum -ADD ./cmd/magneticod /magnetico/cmd/magneticod - -RUN make magneticod - -FROM alpine:latest -LABEL maintainer="bora@boramalper.org" -WORKDIR / -VOLUME /root/.local/share/magneticod -VOLUME /root/.config/magneticod - -COPY --from=build /go/bin/magneticod /magneticod - -ENTRYPOINT ["/magneticod"] diff --git a/Dockerfile.magneticow b/Dockerfile.magneticow deleted file mode 100644 index c5b191d..0000000 --- a/Dockerfile.magneticow +++ /dev/null @@ -1,26 +0,0 @@ -FROM golang:1.19-alpine AS build -WORKDIR /magnetico - -RUN export PATH=$PATH:/go/bin -RUN apk add --no-cache build-base curl git - -ADD ./Makefile /magnetico/ -ADD ./pkg /magnetico/pkg -ADD ./go.mod /magnetico/go.mod -ADD ./go.sum /magnetico/go.sum -ADD ./cmd/magneticow /magnetico/cmd/magneticow - -RUN make magneticow - -FROM alpine:latest -LABEL maintainer="bora@boramalper.org" -EXPOSE 8080 -WORKDIR / -VOLUME /root/.local/share/magneticod -VOLUME /root/.config/magneticow - -RUN apk add --no-cache libgcc libstdc++ - -COPY --from=build /go/bin/magneticow /magneticow - -ENTRYPOINT ["/magneticow"] diff --git a/Makefile b/Makefile index e8d471c..c39e025 100644 --- a/Makefile +++ b/Makefile @@ -1,43 +1,29 @@ -.PHONY: test format vet staticcheck magneticod magneticow image image-magneticow image-magneticod +PREFIX ?= /usr/local +GOFLAGS = -tags='fts5,libsqlite3' -ldflags="-s -w -X main.compiledOn=$(SOURCE_DATE_EPOCH)" -all: test magneticod magneticow +.PHONY: all +all: bin/magneticod bin/magneticow -magneticod: - go install --tags fts5 --tags libsqlite3 "-ldflags=-s -w -X main.compiledOn=`date -u +%Y-%m-%dT%H:%M:%SZ`" ./cmd/magneticod +bin/magneticod: + go install $(GOFLAGS) ./cmd/magneticod -magneticow: +bin/magneticow: # TODO: minify /data/* files! - go install --tags fts5 --tags libsqlite3 "-ldflags=-s -w -X main.compiledOn=`date -u +%Y-%m-%dT%H:%M:%SZ`" ./cmd/magneticow - -.PHONY: docker -docker: docker_up docker_logs - -.PHONY: docker_up -docker_up: - docker-compose up -d - -.PHONY: docker_down -docker_down: - docker-compose down - -.PHONY: docker_logs -docker_logs: - docker-compose logs -ft --tail=10 - -image-magneticod: - docker build -t boramalper/magneticod -f Dockerfile.magneticod . - -image-magneticow: - docker build -t boramalper/magneticow -f Dockerfile.magneticow . - -image: image-magneticod image-magneticow + go install $(GOFLAGS) ./cmd/magneticow +.PHONY: vet vet: go vet ./... -test: - go test --tags libsqlite3 ./... +.PHONY: check +check: + go test $(GOFLAGS) ./... +.PHONY: install +install: bin/magneticod bin/magneticow + install -m 555 -Dt "$(PREFIX)/bin/" bin/magnetico{w,d} + +.PHONY: format format: gofmt -w ./cmd/ gofmt -w ./pkg/ @@ -64,6 +50,7 @@ format: # gofmt -l $(go list -f $'{{range .GoFiles}}{{$.Dir}}/{{.}}\n{{end}}' ./... | grep -v bindata.go) # # The original query is then escaped for Makefile (by repeating dollar signs $ -> $$). +.PHONY: check-formatting check-formatting: SHELL:=/bin/bash # HERE: this is setting the shell for check-formatting only check-formatting: ! gofmt -l $$(go list -f $$'{{range .GoFiles}}{{$$.Dir}}/{{.}}\n{{end}}' ./... | grep -v bindata.go) 2>&1 | tee /dev/fd/2 | read diff --git a/README.md b/README.md index b105e3c..8690b93 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ central entity*. ## Features - Easy installation & minimal requirements: - - [Pre-compiled static binaries](https://github.com/boramalper/magnetico/releases) and [Docker images](https://hub.docker.com/u/boramalper) are provided. + - [Pre-compiled static binaries](https://github.com/boramalper/magnetico/releases) - Root access is *not* required to install or to use. - Near-zero configuration: - Both programs work out of the box, and **magneticow** can be used without a web-server too. @@ -79,26 +79,6 @@ for torrents in the network, hence removing the need for centralised torrent web 2. Install **magneticow** afterwards by following its [installation instructions](cmd/magneticow/README.md). -### Docker - -Run **magneticod** and **magneticow** with: - -``` bash -make docker -``` - -It will run magnetico from already built image on [Docker Hub](https://hub.docker.com/u/boramalper)! - -You should access magneticow at . - -To build fresh images from source, first run: - -``` bash -make image -``` - -Then run `make docker`. It ensures you run updated images of magnetico. - ## License All the code is licensed under AGPLv3, unless stated otherwise specifically. See `COPYING` for diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index aaf4ea5..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: "2" - -services: - magneticod: - image: boramalper/magneticod:latest - volumes: - - ${MAGNETICOD_DATA}:/root/.local/share/magneticod - - ${MAGNETICOD_CONFIG}:/root/.config/magneticod - network_mode: "host" - command: - - "--indexer-addr=0.0.0.0:1212" - - magneticow: - image: boramalper/magneticow:latest - volumes: - - ${MAGNETICOD_DATA}:/root/.local/share/magneticod - - ${MAGNETICOW_CONFIG}:/root/.config/magneticow - ports: - - "8080:8080"