multiarch/goxc!logo
docker-goxc是goxc工具的Docker镜像封装,goxc是一款Go语言构建工具,专注于跨平台编译、应用打包及部署流程。该镜像提供了便捷的跨编译环境,无需在本地配置复杂的Go交叉编译工具链,即可为多种操作系统和架构构建Go应用。
通过以下命令可快速查看goxc工具的帮助信息:
console$ docker run -it --rm multiarch/goxc goxc -h goxc version: 0.17.1 build date: Usage: goxc [<option(s)>] [<task(s)>] Help Options: -h <topic> 帮助 - 默认主题为'options'。也可指定'tasks'或任何任务/别名名称 -ht 帮助 - 显示任务(及任务别名) -version 打印版本信息 -v 详细输出 Help Topics: options 默认) tasks 列出所有任务和别名 <task-name> 任务描述、任务选项和默认值 <alias-name> 列出别名对应的任务 Tasks options: -+tasks= 首先运行的额外任务。参见'-help tasks'获取任务列表 -t 构建交叉编译器工具链。等同于-tasks=toolchain -tasks+= 最后运行的额外任务。参见'-help tasks'获取任务列表 -tasks-= 排除的任务。参见'-help tasks'获取任务列表 Platform filtering: -arch= 指定架构(默认所有架构 - "386 amd64 arm") -bc= 指定构建约束(例如'linux,arm windows') -os= 指定操作系统(默认所有操作系统 - "linux darwin windows freebsd openbsd solaris dragonfly") Config files: -c= 配置名称 -wc (覆)写配置。覆写为累加式。尝试使用goxc -wc生成初始配置 Package versioning: -br= 分支名称(用于fork的仓库) -bu= 构建名称(用于预发布构建) -pr= 预发布信息(通常为'alpha'、'snapshot'等) -pv= 包版本(通常为[major].[minor].[patch],默认'snapshot') Build: -build-ccflags= 构建标志'print-commands' -build-compiler= 构建标志'compiler' -build-gccgoflags= 构建标志 -build-gcflags= 构建标志 -build-installsuffix= 构建标志 -build-ldflags= 构建标志 -build-print-commands= 构建标志'print-commands' -build-processors= 构建时使用的处理器数量 -build-race= 构建标志'race' -build-tags= 构建标志 -build-verbose= 构建标志'verbose' Other options: -codesign= 用于签名darwin二进制文件的身份(仅在主机OS为'darwin'时应用) -d= 目标根目录(默认$GOBIN/(appname)-xc) -env= 使用环境变量 -goroot= 指定Go根目录(当存在多个Go安装时有用) -include= 归档中包含的资源(默认=INSTALL*,README*,LICENSE*) -main-dirs-exclude= 从'main'包中排除的逗号分隔目录(默认=Godeps,testdata,_project,vendor) -max-processors= 最大处理器数量(用于并行任务) -n= 应用名称。默认是目录名称 -o= 编译输出文件名(字符串模板,默认-o="{{.Dest}}{{.PS}}{{.Version}}{{.PS}}{{.Os}}_{{.Arch}}{{.PS}}{{.ExeName}}{{.Ext}}") -pi= 已弃用的选项名称。使用-pr代替 -q= 安静模式(仅输出错误) -resources-exclude= 归档中排除的资源(默认=*.go) -resources-include= 归档中包含的资源(默认=INSTALL*,README*,LICENSE*) -wd= 指定工作目录 -wlc= 写入'local'配置
-h <topic>: 查看帮助信息,默认主题为options,可指定tasks或具体任务/别名名称-ht: 显示所有任务及别名-version: 打印版本信息-v: 详细输出模式-+tasks=: 首先运行的额外任务,需从任务列表中选择-t: 构建交叉编译器工具链,等同于-tasks=toolchain-tasks+=: 最后运行的额外任务,需从任务列表中选择-tasks-=: 排除的任务,需从任务列表中选择-arch=: 指定目标架构,默认支持"386 amd64 arm"-bc=: 指定构建约束,例如'linux,arm windows'-os=: 指定目标操作系统,默认支持"linux darwin windows freebsd openbsd solaris dragonfly"-c=: 配置名称-wc: (覆)写配置,覆写为累加式,可用于生成初始配置-br=: 分支名称(用于fork的仓库)-bu=: 构建名称(用于预发布构建)-pr=: 预发布信息(如'alpha'、'snapshot')-pv=: 包版本,默认'snapshot'-build-ccflags=: 构建标志'print-commands'-build-compiler=: 构建标志'compiler'-build-gccgoflags=: Go编译器标志-build-gcflags=: Go编译器标志-build-installsuffix=: 构建标志-build-ldflags=: 链接器标志-build-print-commands=: 构建标志'print-commands'-build-processors=: 构建时使用的处理器数量-build-race=: 构建标志'race'(启用数据竞争检测)-build-tags=: 构建标签-build-verbose=: 构建标志'verbose'(详细构建输出)-d=: 目标根目录,默认$GOBIN/(appname)-xc-env=: 设置环境变量-goroot=: 指定Go根目录-include=: 归档中包含的资源文件,默认"INSTALL*,README*,LICENSE*"-n=: 应用名称,默认使用目录名称-o=: 输出文件名模板-q=: 安静模式,仅输出错误信息-wd=: 指定工作目录从本地构建scaleway-cli项目,生成多平台可执行文件及归档包:
console$ docker run -it --rm -v $(pwd):/go/src/github.com/scaleway/scaleway-cli -w /go/src/github.com/scaleway/scaleway-cli multiarch/goxc goxc -env=GO15VENDOREXPERIMENT=1 Adding GO15VENDOREXPERIMENT=1 [goxc:go-install] 2016/01/11 10:31:27 Task go-install succeeded [goxc:xc] 2016/01/11 10:31:27 Parallelizing xc for 13 platforms, using max 7 of 8 processors [goxc:xc] 2016/01/11 10:32:17 Task xc succeeded [goxc:codesign] 2016/01/11 10:32:17 Task codesign succeeded [goxc:copy-resources] 2016/01/11 10:32:17 Task copy-resources succeeded [goxc:archive-zip] 2016/01/11 10:32:18 Artifact(s) archived to /go/src/github.com/scaleway/scaleway-cli/dist/1.7.0-rc1/scw_1.7.0-rc1_windows_386.zip [goxc:archive-zip] 2016/01/11 10:32:18 Artifact(s) archived to /go/src/github.com/scaleway/scaleway-cli/dist/1.7.0-rc1/scw_1.7.0-rc1_freebsd_386.zip [goxc:archive-zip] 2016/01/11 10:32:18 Artifact(s) archived to /go/src/github.com/scaleway/scaleway-cli/dist/1.7.0-rc1/scw_1.7.0-rc1_freebsd_arm.zip [goxc:archive-zip] 2016/01/11 10:32:18 Artifact(s) archived to /go/src/github.com/scaleway/scaleway-cli/dist/1.7.0-rc1/scw_1.7.0-rc1_windows_amd64.zip [goxc:archive-zip] 2016/01/11 10:32:18 Artifact(s) archived to /go/src/github.com/scaleway/scaleway-cli/dist/1.7.0-rc1/scw_1.7.0-rc1_freebsd_amd64.zip [goxc:archive-zip] 2016/01/11 10:32:19 Artifact(s) archived to /go/src/github.com/scaleway/scaleway-cli/dist/1.7.0-rc1/scw_1.7.0-rc1_darwin_386.zip [goxc:archive-zip] 2016/01/11 10:32:19 Artifact(s) archived to /go/src/github.com/scaleway/scaleway-cli/dist/1.7.0-rc1/scw_1.7.0-rc1_darwin_amd64.zip [goxc:archive-zip] 2016/01/11 10:32:20 Task archive-zip succeeded [goxc:archive-tar-gz] 2016/01/11 10:32:22 Task archive-tar-gz succeeded [goxc:deb] 2016/01/11 10:32:28 Task deb succeeded [goxc:deb-dev] 2016/01/11 10:32:28 Task deb-dev succeeded [goxc:downloads-page] 2016/01/11 10:32:28 Task downloads-page succeeded [goxc:deb-source] 2016/01/11 10:32:30 Task deb-source succeeded [goxc:downloads-page] 2016/01/11 10:32:30 Task downloads-page succeeded $
从GitHub拉取项目并构建Linux平台的可执行文件,仅需docker环境:
console$ docker run -it --rm -v /tmp:/dist multiarch/goxc sh -xec 'go get -d github.com/moul/anonuuid; goxc -bc=linux -wd /go/src/github.com/moul/anonuuid -env=GO15VENDOREXPERIMENT=1 -d /dist xc' + go get -d github.com/moul/anonuuid + goxc -bc=linux -wd /go/src/github.com/moul/anonuuid -env=GO15VENDOREXPERIMENT=1 -d /dist xc Adding GO15VENDOREXPERIMENT=1 [goxc:xc] 2016/01/11 11:57:19 Parallelizing xc for 3 platforms, using max 7 of 8 processors [goxc:xc] 2016/01/11 11:57:21 Task xc succeeded $ find /tmp/snapshot/ -ls 33685520 4 drwxr-xr-x 5 moul moul 4096 Jan 11 12:55 /tmp/snapshot/ 33685522 4 drwxr-xr-x 2 moul moul 4096 Jan 11 12:57 /tmp/snapshot/linux_arm 33685550 3360 -rwxr-xr-x 1 moul moul 3437720 Jan 11 12:57 /tmp/snapshot/linux_arm/anonuuid 33685549 4 drwxr-xr-x 2 moul moul 4096 Jan 11 12:57 /tmp/snapshot/linux_386 33685559 3368 -rwxr-xr-x 1 moul moul 3448120 Jan 11 12:57 /tmp/snapshot/linux_386/anonuuid 33685521 4 drwxr-xr-x 2 moul moul 4096 Jan 11 12:57 /tmp/snapshot/linux_amd64 33685560 4180 -rwxr-xr-x 1 moul moul 4279736 Jan 11 12:57 /tmp/snapshot/linux_amd64/anonuuid $
MIT许可证
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务