在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:treeder/go开源软件地址:https://github.com/treeder/go开源编程语言:Shell 92.6%开源软件介绍:https://github.com/treeder/djMOVED: I've created a new follow on project for Go and other languages here:This is a Docker image to help you develop in Go (golang). The great thing is you don't need to have anything installed except Docker, you don't even need Go installed. See this post about developing with Docker. This image can perform the following functions:
UsageVendor dependencies:docker run --rm -it -v "$PWD":/app -w /app treeder/go vendor You may need to add more options if you have subdirectory imports: docker run --rm -it -v "$PWD":/app -w /app -e "SRCPATH=github.com/username/reponame" treeder/go vendor The SRCPATH should match your local import statements. Only required if you have subdirectories in the current repository that you are using in imports. Build:docker run --rm -v "$PWD":/app -w /app treeder/go build Run:This is just a normal Docker run. I'm using iron/base here because it's a tiny image that has everything you need to run your Go binary on. docker run --rm -v "$PWD":/app -w /app -p 8080:8080 iron/base ./app Format:docker run --rm -v "$PWD":/app -w /app treeder/go fmt Advanced CommandsBuild a remote git repo:This produces a binary given a remote git repo containing a Go program. docker run --rm -v "$PWD":/app -w /app treeder/go remote https://github.com/treeder/hello-app.go.git You'll end up with a binary called Build a Docker image out of your program:This will build a Docker image with your program inside it. The argument after image is docker run --rm -v "$PWD":/app -w /app -v /var/run/docker.sock:/var/run/docker.sock treeder/go image username/myapp:latest Boom, creates a small Docker image for you. Run Test your new image: docker run --rm -v "$PWD":/app -w /app -p 8080:8080 username/myapp Cross compile:This uses a different image, treeder/go-cross, to do a cross compile. docker run --rm -v "$PWD":/app -w /app treeder/go-cross cross Build static binary:This is great for making the tiniest Docker image possible docker run --rm -v "$PWD":/app -w /app treeder/go static Check Go version:docker run --rm treeder/go version Wrapper ScriptWe've provided a To use it, download it and put it in your
Now you're ready to run the wrapper. It supports the following commands:
TODO:... Building this imagedocker build -t treeder/go:latest . Tag it with Go version too (can check with docker tag treeder/go:latest treeder/go:1.4.2 Push: docker push treeder/go |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论