{"id":18697574,"url":"https://github.com/zhangguanzhang/docker-compose-aarch64","last_synced_at":"2025-04-12T07:32:08.707Z","repository":{"id":104470429,"uuid":"346557026","full_name":"zhangguanzhang/docker-compose-aarch64","owner":"zhangguanzhang","description":"docker-compose v2 已经用 golang 重写了并提供不同架构文件，本仓库只编译 ^1\\.\\d{2}\\.\\d 的 tag ","archived":false,"fork":false,"pushed_at":"2021-11-05T09:15:39.000Z","size":12,"stargazers_count":26,"open_issues_count":0,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T03:01:36.696Z","etag":null,"topics":["aarch64","docker-compose"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhangguanzhang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-11T02:43:41.000Z","updated_at":"2024-04-27T11:42:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd9a118a-8433-4e89-ad97-d8e082391ec0","html_url":"https://github.com/zhangguanzhang/docker-compose-aarch64","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangguanzhang%2Fdocker-compose-aarch64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangguanzhang%2Fdocker-compose-aarch64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangguanzhang%2Fdocker-compose-aarch64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangguanzhang%2Fdocker-compose-aarch64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhangguanzhang","download_url":"https://codeload.github.com/zhangguanzhang/docker-compose-aarch64/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248534063,"owners_count":21120215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aarch64","docker-compose"],"created_at":"2024-11-07T11:24:47.919Z","updated_at":"2025-04-12T07:32:08.683Z","avatar_url":"https://github.com/zhangguanzhang.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 说明\n\ngit 上搜索了很多 docker-compose 的 arm64 的编译基本都是使用 `qemu-user-static` 之类的设置下后编译的，也看到过用特权容器启动 qemu-user-static 或者 `binfmt` 之类的，但是我自己机器上试了无效，貌似是因为我操作系统是低版本内核的 centos ，github 上搜了下，其他很多人的编译感觉太啰嗦了。就在 action 上整了下，测试是可用的，而且非常简单。\n\n\n编译过程看 compose 仓库的 makefile，是运行的 https://github.com/docker/compose/blob/master/script/build/linux 这个脚本。所以克隆 compose 仓库后进目录里，然后 checkout 指定 tag。官方的编译过程都是在 docker build 产生的容器里去编译的。最后有个 build --output就是直接把文件给整出来。我这里是用的 buildx 去替代 build 编译。我仓库整个自动化同步官方 tag checkout 去编译。\n\n** docker-compose v2 已经用 golang 重写了并提供不同架构文件，本仓库只编译 `^1\\.\\d{2}\\.\\d` 的 tag **\n\n## 测试 \n\n### 环境信息\n\n银河麒麟 v10 系统，架构 arm64\n\n```\n$ arch\naarch64\n$ cat /etc/os-release \nNAME=\"Kylin Linux Advanced Server\"\nVERSION=\"V10 (Tercel)\"\nID=\"kylin\"\nVERSION_ID=\"V10\"\nPRETTY_NAME=\"Kylin Linux Advanced Server V10 (Tercel)\"\nANSI_COLOR=\"0;31\"\n------------------\n$ cat /etc/os-release \nNAME=\"Kylin\"\nVERSION=\"4.0.2 (juniper)\"\nID=kylin\nID_LIKE=debian\nPRETTY_NAME=\"Kylin 4.0.2\"\nVERSION_ID=\"4.0.2\"\nHOME_URL=\"http://www.kylinos.cn/\"\nSUPPORT_URL=\"http://www.kylinos.cn/content/service/service.html\"\nBUG_REPORT_URL=\"http://www.kylinos.cn/\"\nUBUNTU_CODENAME=juniper\n```\n\ndocker 版本信息\n\n```\n$ docker info\nContainers: 63\n Running: 44\n Paused: 0\n Stopped: 19\nImages: 24\nServer Version: 18.09.9\nStorage Driver: overlay2\n Backing Filesystem: xfs\n Supports d_type: true\n Native Overlay Diff: true\nLogging Driver: json-file\nCgroup Driver: cgroupfs\nPlugins:\n Volume: local\n Network: bridge host macvlan null overlay\n Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog\nSwarm: inactive\nRuntimes: runc\nDefault Runtime: runc\nInit Binary: docker-init\ncontainerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb\nrunc version: 425e105d5a03fabd737a126ad93d62a9eeede87f\ninit version: fec3683\nSecurity Options:\n seccomp\n  Profile: default\nKernel Version: 4.19.90-17.ky10.aarch64\nOperating System: Kylin Linux Advanced Server V10 (Tercel)\nOSType: linux\nArchitecture: aarch64\nCPUs: 64\nTotal Memory: 62.76GiB\nName: reg.xxx.lan\nID: RI24:C6CM:WELZ:MQEJ:N5OY:IR74:OQPG:XV72:SFRI:NUSK:DS44:OQNQ\nDocker Root Dir: /data/kube/docker\nDebug Mode (client): false\nDebug Mode (server): false\nRegistry: https://index.docker.io/v1/\nLabels:\nExperimental: false\nInsecure Registries:\n reg.xxx.lan:5000\n treg.yun.xxx.cn\n 127.0.0.0/8\nRegistry Mirrors:\n https://registry.docker-cn.com/\n https://docker.mirrors.ustc.edu.cn/\nLive Restore Enabled: false\nProduct License: Community Engine\n```\n\n### 测试运行\n\n```\n$ ldd ./docker-compose-linux-arm64 \n\tlinux-vdso.so.1 (0x0000fffd72210000)\n\tlibdl.so.2 =\u003e /lib64/libdl.so.2 (0x0000fffd721a0000)\n\tlibz.so.1 =\u003e /lib64/libz.so.1 (0x0000fffd72160000)\n\tlibc.so.6 =\u003e /lib64/libc.so.6 (0x0000fffd71fd0000)\n\t/lib/ld-linux-aarch64.so.1 (0x0000fffd72220000)\n$ ll\n总用量 10504\ndrwxr-xr-x 2 root root       26  3月 13 11:11 conf.d\n-rwxr-xr-x 1 root root 10750256  3月 12 13:15 docker-compose-linux-arm64\n-rw-r--r-- 1 root root      389  3月 13 11:11 docker-compose.yml\ndrwxr-xr-x 2 root root        6  3月 13 11:11 down\n$ mkdir -p conf.d down\n$ cat \u003e conf.d/default.conf \u003c\u003c EOF\nserver {\n    listen       81;\n    server_name  localhost;\n    location / {\n        root   /usr/share/nginx/html;\n        index  index.html index.htm;\n        autoindex    on;\n    }\n    error_page   500 502 503 504  /50x.html;\n    location = /50x.html {\n        root   /usr/share/nginx/html;\n    }\n}\nEOF\n$ cat docker-compose.yml \nversion: '3.4'\nservices:\n  nginx:\n    image: nginx:alpine\n    container_name: install-nginx\n    hostname: install-nginx\n    volumes:\n      - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro\n      - ./down:/usr/share/nginx/html\n      - ./conf.d/:/etc/nginx/conf.d/\n    network_mode: \"host\"\n    logging:\n      driver: json-file\n      options:\n        max-file: '3'\n        max-size: 100m\n\n$ ./docker-compose-linux-arm64 up -d\nPulling nginx (nginx:alpine)...\nalpine: Pulling from library/nginx\nDigest: sha256:c2ce58e024275728b00a554ac25628af25c54782865b3487b11c21cafb7fabda\nStatus: Downloaded newer image for nginx:alpine\nCreating install-nginx ... done\n$./docker-compose-linux-arm64 ps -a\n    Name                   Command               State   Ports\n--------------------------------------------------------------\ninstall-nginx   /docker-entrypoint.sh ngin ...   Up           \n$ netstat -nlptu | grep -E ':81\\s'\ntcp        0      0 0.0.0.0:81              0.0.0.0:*               LISTEN      4093364/nginx: mast \n```\n\n页面访问了下正常，清理\n\n```\n$ ./docker-compose-linux-arm64 down\nStopping install-nginx ... done\nRemoving install-nginx ... done\n```\n\n\n## 参考资料\n\n- https://github.com/ubiquiti/docker-compose-aarch64\n- https://github.com/RogerLaw/docker-compose-aarch64\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhangguanzhang%2Fdocker-compose-aarch64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhangguanzhang%2Fdocker-compose-aarch64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhangguanzhang%2Fdocker-compose-aarch64/lists"}