Skip to content

Commit

Permalink
Merge pull request #121 from ilveroluca/feature/multi-arch-docker
Browse files Browse the repository at this point in the history
multi arch docker support
  • Loading branch information
ysde authored Feb 3, 2021
2 parents f5c9868 + a816bc7 commit 65ec524
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
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

0 comments on commit 65ec524

Please sign in to comment.