镜像概览

完整引用
docker.io/ethereum/solc
Registry
docker.io
命名空间
ethereum
仓库
solc
已缓存 Tag 数
5122
最近同步
07/06/2026, 04:05 PM

简介

Ethereum 官方 Solidity 编译器 CLI 镜像,将 .sol 合约编译为 EVM 字节码与 ABI,供 CI 流水线或本地开发一次性构建任务使用。

详细介绍

ethereum/solc 封装各版本 Solidity 编译器,开发者挂载合约目录后执行 solc --abi --bin 输出产物。镜像定位为 ephemeral 编译工具,任务完成即退出,不适合 作为 Kubernetes 常驻 Deployment 或 HTTP 服务。与 Hardhat/Foundry 内置编译器相比容器版 pin 了 solc 版本便于可重现构建;Pipeline 中应以 --rm 运行并挂载 spec 与 output 目录。

快速启动

docker run --rm \
  -v $(pwd):/sources \
  docker.io/ethereum/solc:latest \
  --abi --bin -o /sources/out /sources/Contract.sol

推荐实践

docker run --rm \
  -v $(pwd)/contracts:/sources \
  -v $(pwd)/build:/out \
  docker.io/ethereum/solc:0.8.26 \
  --abi --bin --optimize --optimize-runs 200 \
  -o /out /sources/MyToken.sol

核心参数说明

  • -v .../contracts:/sources — 挂载 Solidity 源文件
  • -v .../build:/out — 编译产物输出目录
  • --optimize --optimize-runs 200 — 启用优化及 runs 参数
  • 0.8.26 — 固定 solc 版本 tag
  • --rm — 编译完成自动清理容器
  • 版本 — tag 须与合约 pragma 匹配

最新 Tag(20 条)

查看全部 5122 个 Tag →
Tag架构推送时间大小Digest同步期望操作
docker.io/ethereum/solc
:0.8.30-alpine
linux/amd64
2025/05/07 21:559.1 MBsha256:968cb5ba4b4c
docker.io/ethereum/solc
:stable-alpine
linux/amd64
2025/05/07 21:559.1 MBsha256:968cb5ba4b4c
docker.io/ethereum/solc
:0.8.30
linux/amd64
2025/05/07 21:545.9 MBsha256:b116bf835554
docker.io/ethereum/solc
:stable
linux/amd64
2025/05/07 21:545.9 MBsha256:b116bf835554
docker.io/ethereum/solc
:0.8.29-alpine
linux/amd64
2025/03/12 18:409.2 MBsha256:a7a9b57f4d26
docker.io/ethereum/solc
:0.8.29
linux/amd64
2025/03/12 18:405.9 MBsha256:fd52315e8891
docker.io/ethereum/solc
:0.8.28-alpine
linux/amd64
2024/10/09 17:239.1 MBsha256:344fc82c3fa4
docker.io/ethereum/solc
:0.8.28
linux/amd64
2024/10/09 17:235.8 MBsha256:b3b83d65e1ea
docker.io/ethereum/solc
:0.8.27-alpine
linux/amd64
2024/09/04 17:589.1 MBsha256:c8ae9f7862cf
docker.io/ethereum/solc
:0.8.27
linux/amd64
2024/09/04 17:585.8 MBsha256:c74c43c73e64
docker.io/ethereum/solc
:0.8.26-alpine
linux/amd64
2024/05/21 19:529.0 MBsha256:378e4aa9bf02
docker.io/ethereum/solc
:0.8.26
linux/amd64
2024/05/21 19:515.7 MBsha256:0158f0b11d4c
docker.io/ethereum/solc
:0.8.25-alpine
linux/amd64
2024/03/14 20:228.8 MBsha256:39beed12bfc0
docker.io/ethereum/solc
:0.8.25
linux/amd64
2024/03/14 20:215.6 MBsha256:231d46593eae
docker.io/ethereum/solc
:0.8.24-alpine
linux/amd64
2024/01/26 02:3410.8 MBsha256:8e9c10e57861
docker.io/ethereum/solc
:0.8.24
linux/amd64
2024/01/26 02:3410.8 MBsha256:e56ef5e376ae
docker.io/ethereum/solc
:0.8.23-alpine
linux/amd64
2023/11/08 22:398.5 MBsha256:d21988a3e70b
docker.io/ethereum/solc
:0.8.23
linux/amd64
2023/11/08 22:395.3 MBsha256:63a27f290842
docker.io/ethereum/solc
:0.8.22-alpine
linux/amd64
2023/10/25 19:378.6 MBsha256:aea25ed8cc4e
docker.io/ethereum/solc
:0.8.22
linux/amd64
2023/10/25 19:375.3 MBsha256:7a3bd6515ec8