Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aarch64 docker image for ckb #4256

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,25 @@ prod-with-debug:

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

docker-aarch64:
docker build -f docker/hub/Dockerfile-aarch64 -t nervos/ckb:aarch64-$$(git describe) .

.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"]
Loading