如何用新鲜或空气重建go golang应用程序?

我从本地卷更改文件时,gravityblast / fresh和cosmtrek / air无法重建main.go。我哪里错了? https://www.youtube.com/watch?v=GuQqatSTO7w

Dockerfile

# create image from the official Go image
FROM golang:alpine
RUN apk add --update tzdata \
    bash wget curl git nano;
# Create binary directory,install glide and fresh
RUN mkdir -p $$GOPATH/bin && \
    # curl https://glide.sh/get | sh && \
    # go get github.com/pilu/fresh && \
    curl -fLo ~/.air https://raw.githubusercontent.com/cosmtrek/air/master/bin/linux/air && \
    chmod +x ~/.air

# define work directory
ADD . /go/src/app
WORKDIR /go/src/app


# serve the app1
CMD ~/.air -c air.conf

RUN chmod -R 0777 $GOPATH/src
wcr997 回答:如何用新鲜或空气重建go golang应用程序?

由于类似的问题:https://github.com/fsnotify/fsnotify/issues/292

FS通知事件不是由主机Windows文件更新触发的:

  

我不确定Windows的Docker如何安装共享文件夹,但是   通常是文件共享...不支持通知。

此问题似乎并不影响MacOS或Linux主机。

如果必须在Windows上,则此软件包可能会有所帮助:

Usage of docker-windows-volume-watcher:

  -container string
        Name of the container instance that you wish to notify of filesystem changes

  -delay int
        Delay in milliseconds before notifying about a file that's changed (default 100)

  -ignore string
        Semicolon-separated list of directories to ignore. Glob expressions are supported. (default "node_modules;vendor")

  -path string
        Root path where to watch for changes
本文链接:https://www.f2er.com/3121295.html

大家都在问