Skip to content

Commit

Permalink
Merge pull request #2 from jungsoft/new-platforms
Browse files Browse the repository at this point in the history
Add binary for ARM64
  • Loading branch information
gabrielpra1 authored Dec 20, 2021
2 parents b51f690 + e7ba3e1 commit 18650b5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,32 @@

A simple binary that can be used as healthcheck in docker containers.

This repository also contains a binary file built for Alpine.
This repository also contains binary files built for Alpine AMD64 and ARM64.

## Usage

Include the binary in your image, either by COPYing from disk or ADDing directly from this repo, then use it as HEALTHCHECK:

For alpine linux:
For alpine linux AMD64:

```Dockerfile
FROM alpine

ADD https://github.com/jungsoft/docker-healthcheck/releases/download/0.0.1/healthcheck-alpine /usr/local/bin/healthcheck
ADD https://github.com/jungsoft/docker-healthcheck/releases/download/0.1.0/healthcheck_alpine_amd64 /usr/local/bin/healthcheck
RUN chmod +x /usr/local/bin/healthcheck

HEALTHCHECK CMD healthcheck
```

If doing a multiplatform build, you can also do:
```Dockerfile
FROM alpine
ARG TARGETARCH

ADD hhttps://github.com/jungsoft/docker-healthcheck/releases/download/0.1.0/healthcheck_alpine_$TARGETARCH /usr/local/bin/healthcheck
RUN chmod +x /usr/local/bin/healthcheck
```

Or if you prefer COPYing:

```Dockerfile
Expand All @@ -32,10 +41,10 @@ HEALTHCHECK CMD healthcheck

## Building

To build it for alpine, you can use the go-alpine image, for example:
To build it for alpine, you can use the go-alpine image, for example (alternatively, for ARM64, you can use `docker run --rm -it arm64v8/golang:1.17-alpine`):

```bash
docker run --rm -it golang:1.14.3-alpine
docker run --rm -it golang:1.17-alpine
```

Then copy the go file to the running container:
Expand Down
Binary file removed healthcheck
Binary file not shown.
Binary file added healthcheck_alpine_amd64
Binary file not shown.
Binary file added healthcheck_alpine_arm64
Binary file not shown.

0 comments on commit 18650b5

Please sign in to comment.