我需要在 GitHub 操作中定义一个服务,并通过向其添加参数来覆盖其入口点。我怎样才能做到这一点?
这是我正在尝试翻译的一个可以运行的 docker-compose。
version: '2'
services:
config:
build: .
links:
- etcd
etcd:
image: microbox/etcd:2.1.1
entrypoint: "etcd --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379"
hostname: etcd
container_name: build_etcd
expose:
- 2379
这是我的操作以及我最初认为它是如何工作的......
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
services:
etcd:
image: microbox/etcd:2.1.1
options: --entrypoint 'etcd --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379'
steps:
...
然而,在初始化容器时,它会崩溃,因为它运行的命令不正确......
/usr/bin/docker create --name 1062a703242743a29bbcfda9fc19c823_microboxetcd211_3767cc --label 488dfb --network github_network_244f1c7676b8488e99c66694d06a21f2 --network-alias etcd --entrypoint 'etcd --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379' -e GITHUB_ACTIONS=true microbox/etcd:2.1.1
错误是unknown flag: --listen-client-urls
我想其实应该是这样的……
/usr/bin/docker create --name 1062a703242743a29bbcfda9fc19c823_microboxetcd211_3767cc --label 488dfb --network github_network_244f1c7676b8488e99c66694d06a21f2 --network-alias etcd --entrypoint etcd -e GITHUB_ACTIONS=true microbox/etcd:2.1.1 --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379
有什么想法可以在 GitHub Action Service 定义中使用传递给可执行文件的参数来覆盖入口点吗?