Skip to content

Commit

Permalink
Merge pull request #4256 from chenyukang/yukang-add-aarch64
Browse files Browse the repository at this point in the history
Add aarch64 docker image  for ckb
  • Loading branch information
chenyukang authored Dec 12, 2023
2 parents 302a7d7 + f80b304 commit 2f44fb0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
21 changes: 15 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,27 @@ prod-with-debug:

.PHONY: docker
docker: ## Build docker image
docker build -f docker/hub/Dockerfile -t nervos/ckb:$$(git describe) .
docker run --rm -it nervos/ckb:$$(git describe) --version
docker build -f docker/hub/Dockerfile -t nervos/ckb:x64-$$(git describe) .
docker run --rm -it nervos/ckb:x64-$$(git describe) --version

.PHONY: docker-aarch64
docker-aarch64:
docker build -f docker/hub/Dockerfile-aarch64 -t nervos/ckb:aarch64-$$(git describe) .
docker run --rm -it nervos/ckb:aarch64-$$(git describe) --version

.PHONY: docker-publish
docker-publish:
docker push nervos/ckb:$$(git describe)
docker tag nervos/ckb:$$(git describe) nervos/ckb:latest
docker push nervos/ckb:latest
docker push nervos/ckb:x64-$$(git describe)
docker push nervos/ckb:aarch64-$$(git describe)
docker manifest create nervos/ckb:latest nervos/ckb:x64-$$(git describe) nervos/ckb:aarch64-$$(git describe)
docker manifest push nervos/ckb:latest

.PHONY: docker-publish-rc
docker-publish-rc:
docker push nervos/ckb:$$(git describe)
docker push nervos/ckb:x64-$$(git describe)
docker push nervos/ckb:aarch64-$$(git describe)
docker manifest create nervos/ckb:$$(git describe) nervos/ckb:x64-$$(git describe) nervos/ckb:aarch64-$$(git describe)
docker manifest push nervos/ckb:$$(git describe)

##@ Code Quality
.PHONY: fmt
Expand Down
31 changes: 31 additions & 0 deletions docker/hub/Dockerfile-aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM nervos/ckb-docker-builder:aarch64-rust-1.71.1 as ckb-docker-builder

WORKDIR /ckb
COPY ./ .

RUN make prod-docker

FROM arm64v8/ubuntu
LABEL description="Nervos CKB is a public permissionless blockchain, the common knowledge layer of Nervos network."
LABEL maintainer="Nervos Core Dev <dev@nervos.org>"

RUN groupadd -g 1000 ckb \
&& useradd -m -u 1000 -g ckb -s /bin/sh ckb \
&& mkdir -p /var/lib/ckb

WORKDIR /var/lib/ckb

COPY --from=ckb-docker-builder \
/usr/lib/aarch64-linux-gnu/libssl.so.* \
/usr/lib/aarch64-linux-gnu/libcrypto.so.* \
/usr/lib/aarch64-linux-gnu/
COPY --from=ckb-docker-builder /ckb/target/prod/ckb /ckb/docker/docker-entrypoint.sh /bin/
RUN chown -R ckb:ckb /var/lib/ckb \
&& chmod 755 /var/lib/ckb

USER ckb
ENV CKB_CHAIN=mainnet

EXPOSE 8114 8115
VOLUME ["/var/lib/ckb"]
ENTRYPOINT ["/bin/docker-entrypoint.sh"]

0 comments on commit 2f44fb0

Please sign in to comment.