SuRenPi

  • 博客
  • 翻译
  • 开源
  • Slide

此页面上的内容

  • Install multi-arch binary files in one Dockerfile

How to build a multi-arch docker image

How to build a multi-arch docker image

Install multi-arch binary files in one Dockerfile

FROM ubuntu

RUN ARCH= && ARCH_ALIAS= && dpkgArch="$(dpkg --print-architecture)" \
  && case "${dpkgArch##*-}" in \
    amd64) ARCH='amd64';; \
    ppc64el) ARCH='ppc64le';; \
    s390x) ARCH='s390x';; \
    arm64) ARCH='arm64';; \
    armhf) ARCH='armv7l';; \
    i386) ARCH='x86';; \
    *) echo "unsupported architecture"; exit 1 ;; \
  esac && \
  apt-get update && apt-get install wget -y && \
  wget https://cdn.jsdelivr.net/gh/jenkins-zh/jcli-repo/jcli-linux-$ARCH.tar.gz && \
  tar xzvf jcli-linux-$ARCH.tar.gz && rm -rf jcli-linux-$ARCH.tar.gz

Save those content into Dockerfile, then execute command docker buildx build --platform linux/amd64,linux/arm64 . -f Dockerfile -t jcli:test

  • DevOps
    • Jenkins
    • 容器技术
    • API
    • General topic About DevOps
    • Jenkins X
    • Kubernetes
    • Team
    • 构建
  • 编程语言
    • Golang
    • Java
    • Python
    • TypeScript
  • 操作系统
    • Linux
    • Mac
  • 其他内容
“How to build a multi-arch docker image” was last updated: January 1, 0001
改善此页
由 SuRen 维护
  • File an Issue
 

Copyright 2018–2024 the original authors.

  • 博客
  • 翻译
  • 开源
  • Slide