Skip to content

Commit

Permalink
chore: Add support to ARM64
Browse files Browse the repository at this point in the history
Signed-off-by: Abdelkader Boudih <terminale@gmail.com>
  • Loading branch information
seuros authored and SimoneLazzaris committed Apr 4, 2024
1 parent c7265c6 commit 063d41a
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 14 deletions.
1 change: 1 addition & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ GOOS=linux GOARCH=amd64 make immuclient-static immuadmin-static immudb-static
```

## MacOS (by component)
For Apple Silicon (M1) use `GOARCH=arm64` instead of `GOARCH=amd64`

```bash
GOOS=darwin GOARCH=amd64 make immuclient-static immuadmin-static immudb-static
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

FROM golang:1.18 as build
ARG BUILD_ARCH=amd64
WORKDIR /src
COPY go.mod go.sum /src/
RUN go mod download -x
Expand All @@ -21,7 +22,7 @@ RUN make clean
RUN make prerequisites
RUN make swagger
RUN make swagger/dist
RUN GOOS=linux GOARCH=amd64 WEBCONSOLE=default SWAGGER=true make immudb-static immuadmin-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} WEBCONSOLE=default SWAGGER=true make immudb-static immuadmin-static
RUN mkdir /empty

FROM scratch
Expand Down
5 changes: 3 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM golang:1.18 as build
ARG BUILD_ARCH=amd64
WORKDIR /src
COPY go.mod go.sum /src/
RUN go mod download -x
Expand All @@ -7,8 +8,8 @@ RUN make clean
RUN make prerequisites
RUN make swagger
RUN make swagger/dist
RUN GOOS=linux GOARCH=amd64 WEBCONSOLE=default SWAGGER=true make immudb-static
RUN GOOS=linux GOARCH=amd64 make immuadmin-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} WEBCONSOLE=default SWAGGER=true make immudb-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} make immuadmin-static
RUN mkdir /empty

FROM debian:bullseye-slim as bullseye-slim
Expand Down
5 changes: 3 additions & 2 deletions build/Dockerfile.alma
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM golang:1.18 as build
ARG BUILD_ARCH=amd64
WORKDIR /src
COPY . .
RUN make clean
RUN make prerequisites
RUN make swagger
RUN make swagger/dist
RUN GOOS=linux GOARCH=amd64 WEBCONSOLE=default SWAGGER=true make immudb-static
RUN GOOS=linux GOARCH=amd64 make immuadmin-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} WEBCONSOLE=default SWAGGER=true make immudb-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} make immuadmin-static
RUN mkdir /empty

FROM almalinux:8-minimal as alma
Expand Down
5 changes: 3 additions & 2 deletions build/Dockerfile.full
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM golang:1.18 as build
ARG BUILD_ARCH=amd64
WORKDIR /src
COPY go.mod go.sum /src/
RUN go mod download -x
Expand All @@ -7,8 +8,8 @@ RUN make clean
RUN make prerequisites
RUN make swagger
RUN make swagger/dist
RUN GOOS=linux GOARCH=amd64 WEBCONSOLE=default SWAGGER=true make immudb-static
RUN GOOS=linux GOARCH=amd64 make immuadmin-static immuclient-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} WEBCONSOLE=default SWAGGER=true make immudb-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} make immuadmin-static immuclient-static
RUN mkdir /empty

FROM debian:11.7-slim as bullseye-slim
Expand Down
3 changes: 2 additions & 1 deletion build/Dockerfile.immuadmin
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM golang:1.18 as build
ARG BUILD_ARCH=amd64
WORKDIR /src
COPY . .
RUN GOOS=linux GOARCH=amd64 make immuadmin-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} make immuadmin-static

FROM debian:11.7-slim as bullseye
LABEL org.opencontainers.image.authors="Codenotary Inc. <info@codenotary.com>"
Expand Down
3 changes: 2 additions & 1 deletion build/Dockerfile.immuclient
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM golang:1.18 as build
ARG BUILD_ARCH=amd64
WORKDIR /src
COPY . .
RUN GOOS=linux GOARCH=amd64 make immuclient-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} make immuclient-static

FROM debian:11.7-slim as bullseye
LABEL org.opencontainers.image.authors="Codenotary Inc. <info@codenotary.com>"
Expand Down
5 changes: 3 additions & 2 deletions build/Dockerfile.rndpass
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM golang:1.18 as build
ARG BUILD_ARCH=amd64
WORKDIR /src
COPY . .
RUN make clean
RUN make prerequisites
RUN make swagger
RUN make swagger/dist
RUN GOOS=linux GOARCH=amd64 WEBCONSOLE=default SWAGGER=true make immudb-static
RUN GOOS=linux GOARCH=amd64 make immuadmin-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} WEBCONSOLE=default SWAGGER=true make immudb-static
RUN GOOS=linux GOARCH=${BUILD_ARCH} make immuadmin-static

FROM debian:11.7-slim
LABEL org.opencontainers.image.authors="Codenotary Inc. <info@codenotary.com>"
Expand Down
1 change: 1 addition & 0 deletions build/e2e/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM golang:1.18 as build
ARG BUILD_ARCH=amd64
WORKDIR /src
COPY go.mod go.sum /src/
RUN go mod download
Expand Down
3 changes: 2 additions & 1 deletion build/fips/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# This version of Go is a Go+BoringCrypto release for FIPS 140-2 compliance
FROM us-docker.pkg.dev/google.com/api-project-999119582588/go-boringcrypto/golang:1.18.5b7 as build-fips
ARG BUILD_ARCH=amd64
WORKDIR /src
COPY go.mod go.sum /src/
RUN go mod download -x
COPY . .
RUN rm -rf /src/webconsole/dist
RUN GOOS=linux GOARCH=amd64 WEBCONSOLE=default make immuadmin-fips immudb-fips
RUN GOOS=linux GOARCH=${BUILD_ARCH} WEBCONSOLE=default make immuadmin-fips immudb-fips
RUN mkdir /empty

### distroless FIPS 140-2
Expand Down
3 changes: 2 additions & 1 deletion build/fips/Dockerfile.immuadmin
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM us-docker.pkg.dev/google.com/api-project-999119582588/go-boringcrypto/golang:1.18.5b7 as build
ARG BUILD_ARCH=amd64
WORKDIR /src
COPY . .
RUN GOOS=linux GOARCH=amd64 make immuadmin-fips
RUN GOOS=linux GOARCH=${BUILD_ARCH} make immuadmin-fips

### distroless FIPS 140-2
FROM gcr.io/distroless/base:nonroot AS distroless-fips
Expand Down
2 changes: 1 addition & 1 deletion build/fips/Dockerfile.immuclient
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM us-docker.pkg.dev/google.com/api-project-999119582588/go-boringcrypto/golang:1.18.5b7 as build
WORKDIR /src
COPY . .
RUN GOOS=linux GOARCH=amd64 make immuclient-fips
RUN GOOS=linux GOARCH=${BUILD_ARCH} make immuclient-fips

### distroless FIPS 140-2
FROM gcr.io/distroless/base:nonroot AS distroless-fips
Expand Down

0 comments on commit 063d41a

Please sign in to comment.