go docker-compose
version: "3.8" services: tyche: build: context: . dockerfile: dockerfile-tyche entrypoint: ["/ethgo/tyche_main"] container_name: tyche volumes: - ./docker_contain/:/ethgo/logs/ # restart: always network_mode: "host" logging: driver: "json-file" options: max-size: "1g" tty: true
FROM alpine COPY ./cmd/tyche/ /ethgo/ COPY ./tyche_main /ethgo/tyche_main RUN chmod +x /ethgo/tyche_main && mkdir -p /ethgo/log/ WORKDIR /ethgo/ #CMD ["/ethgo/tyche_main"]
注意 go build 指定环境变量 如果使用powershell 最好使用
$env:GOOS = "linux"