Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi arch docker support #121

Merged
merged 2 commits into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk
WORKDIR /opt/grafana-backup-tool
ADD . /opt/grafana-backup-tool

RUN chmod -R a+r /opt/grafana-backup-tool \
&& find /opt/grafana-backup-tool -type d -print0 | xargs -0 chmod a+rx

RUN pip3 --no-cache-dir install .

RUN chown -R 1337:1337 /opt/grafana-backup-tool
Expand Down
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
FULLTAG=alpinebased:grafana-backup

DOCKER_REPO ?= ysde
DOCKER_NAME := grafana-backup
DOCKER_TAG ?= latest
PLATFORMS ?= linux/amd64,linux/arm/v7

FULLTAG = $(DOCKER_REPO)/$(DOCKER_NAME):$(DOCKER_TAG)

DOCKERFILE=Dockerfile

all: build

build:
docker build -t $(FULLTAG) -f $(DOCKERFILE) .

push: build
docker push $(FULLTAG)


buildx_and_push:
docker buildx build \
--output type=image,name=$(DOCKER_REPO)/$(DOCKER_NAME),push=true \
--platform linux/amd64,linux/arm/v7 \
--tag $(FULLTAG) \
--file $(DOCKERFILE) .
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ sudo chown 1337:1337 /tmp/backup
```

```
docker run --rm --name grafana-backup-tool \
docker run --user $(id -u):$(id -g) --rm --name grafana-backup-tool \
-e GRAFANA_TOKEN={YOUR_GRAFANA_TOKEN} \
-e GRAFANA_URL={YOUR_GRAFANA_URL} \
-e GRAFANA_ADMIN_ACCOUNT={YOUR_GRAFANA_ADMIN_ACCOUNT} \
Expand All @@ -131,7 +131,7 @@ docker run --rm --name grafana-backup-tool \
***Example:***

```
docker run --rm --name grafana-backup-tool \
docker run --user $(id -u):$(id -g) --rm --name grafana-backup-tool \
-e GRAFANA_TOKEN="eyJrIjoiNGZqTDEyeXNaY0RsMXNhbkNTSnlKN2M3bE1VeHdqVTEiLCJuIjoiZ3JhZmFuYS1iYWNrdXAiLCJpZCI6MX0=" \
-e GRAFANA_URL=http://192.168.0.79:3000 \
-e GRAFANA_ADMIN_ACCOUNT=admin \
Expand All @@ -150,7 +150,7 @@ docker run --rm --name grafana-backup-tool \
### Restore

```
docker run --rm --name grafana-backup-tool \
docker run --user $(id -u):$(id -g) --rm --name grafana-backup-tool \
-e GRAFANA_TOKEN={YOUR_GRAFANA_TOKEN} \
-e GRAFANA_URL={YOUR_GRAFANA_URL} \
-e GRAFANA_ADMIN_ACCOUNT={YOUR_GRAFANA_ADMIN_ACCOUNT} \
Expand All @@ -165,7 +165,7 @@ docker run --rm --name grafana-backup-tool \
***Example:***

```
docker run --rm --name grafana-backup-tool \
docker run --user $(id -u):$(id -g) --rm --name grafana-backup-tool \
-e GRAFANA_TOKEN="eyJrIjoiNGZqTDEyeXNaY0RsMXNhbkNTSnlKN2M3bE1VeHdqVTEiLCJuIjoiZ3JhZmFuYS1iYWNrdXAiLCJpZCI6MX0=" \
-e GRAFANA_URL=http://192.168.0.79:3000 \
-e GRAFANA_ADMIN_ACCOUNT=admin \
Expand Down