Skip to content

Commit

Permalink
add ARM64 docker image
Browse files Browse the repository at this point in the history
Signed-off-by: Slach <[email protected]>
  • Loading branch information
Slach committed Aug 9, 2024
1 parent 0af7f2a commit 3e6a1da
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
.vagrant/
flame-graphs/
dist/
docs/
docker/clickhouse/
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
Expand All @@ -7,13 +6,12 @@ services:
- ./docker/clickhouse/tls.xml:/etc/clickhouse-server/config.d/tls.xml
- ./docker/clickhouse/ssl/:/etc/clickhouse-server/ssl/
ports:
- 8123:8123
- 8443:8443
- "8123:8123"
- "8443:8443"
clickhouse-flamegraph:
image: clickhousepro/clickhouse-flamegraph
volumes:
- ./:/go/src/github.com/Slach/clickhouse-flamegraph
- /tmp/:/tmp/
build:
context: .
dockerfile: docker/clickhouse-flamegraph/Dockerfile
Expand Down
12 changes: 7 additions & 5 deletions docker/clickhouse-flamegraph/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM golang:alpine AS builder
MAINTAINER Eugene Klimov <[email protected]>

FROM --platform=$BUILDPLATFORM golang:alpine AS builder
ARG TARGETPLATFORM
LABEL maintainer="Eugene Klimov <[email protected]>"
USER root
COPY ./ /go/src/github.com/Slach/clickhouse-flamegraph
WORKDIR /go/src/github.com/Slach/clickhouse-flamegraph
RUN go mod tidy
RUN go build -o /usr/bin/clickhouse-flamegraph main.go
RUN --mount=type=cache,id=clickhouse-flamegraph-gobuild,target=/root/ go mod download -x
RUN --mount=type=cache,id=clickhouse-flamegraph-gobuild,target=/root/ GOOS=$( echo ${TARGETPLATFORM} | cut -d "/" -f 1) GOARCH=$( echo ${TARGETPLATFORM} | cut -d "/" -f 2) go build -o /usr/bin/clickhouse-flamegraph main.go
RUN apk --no-cache add git
RUN git clone https://github.com/brendangregg/FlameGraph.git /opt/flamegraph/

FROM alpine:3.20
FROM alpine:latest
RUN apk --no-cache add bash tzdata perl
COPY --from=builder /opt/flamegraph /opt/flamegraph
RUN ln -vsf /opt/flamegraph/flamegraph.pl /usr/bin/flamegraph.pl
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-publisher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ docker login -u ${DOCKER_LOGIN} -p ${DOCKER_PASSWORD} docker.io
set -x

set -xeuo pipefail
docker compose build --pull clickhouse-flamegraph
docker compose push clickhouse-flamegraph
docker buildx build -f docker/clickhouse-flamegraph/Dockerfile --platform=linux/amd64,linux/arm64 --progress plain --pull --push --tag clickhousepro/clickhouse-flamegraph:latest .

echo "docker publishing done"

0 comments on commit 3e6a1da

Please sign in to comment.