mirror of
https://github.com/dockersrc/go
synced 2026-06-24 14:01:08 -04:00
📝 Fix README inaccuracies 📝
- docker-compose: add `command: tail null` so the container stays alive instead of running go-workflow and immediately exiting - Persistence: remove stale symlinks table — those were created by the old 00-go.sh which has been stripped; symlinks no longer exist - Cross-compile: wrap bare `go build` examples in `docker run` so they are valid as written, not ambiguous host-vs-container commands - Development: fix clone URLs from casjaysdev/go to dockersrc/go README.md
This commit is contained in:
@@ -83,12 +83,12 @@ services:
|
|||||||
image: casjaysdev/go:latest
|
image: casjaysdev/go:latest
|
||||||
container_name: casjaysdev-go
|
container_name: casjaysdev-go
|
||||||
hostname: go
|
hostname: go
|
||||||
|
command: tail null
|
||||||
environment:
|
environment:
|
||||||
- TZ=America/New_York
|
- TZ=America/New_York
|
||||||
volumes:
|
volumes:
|
||||||
- go-state:/usr/local/share/go
|
- go-state:/usr/local/share/go
|
||||||
- .:/app
|
- .:/app
|
||||||
working_dir: /app
|
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
@@ -222,16 +222,6 @@ docker run -v go-state:/usr/local/share/go ...
|
|||||||
docker run -v ~/go:/usr/local/share/go ...
|
docker run -v ~/go:/usr/local/share/go ...
|
||||||
```
|
```
|
||||||
|
|
||||||
Convenience symlinks also resolve to the canonical path:
|
|
||||||
|
|
||||||
| Symlink | Notes |
|
|
||||||
|---------|-------|
|
|
||||||
| `/go` | Legacy Docker convention — matches the official `golang` image |
|
|
||||||
| `/root/go` | Go's default `~/go` GOPATH |
|
|
||||||
| `/root/.go` | Hidden variant |
|
|
||||||
| `/root/.local/share/go` | XDG base-dir variant |
|
|
||||||
| `/data/go` | Created at container start |
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🌐 Cross-compile
|
## 🌐 Cross-compile
|
||||||
@@ -240,14 +230,15 @@ With `CGO_ENABLED=0` (the default) the Go toolchain cross-compiles pure-Go
|
|||||||
binaries with no extra setup:
|
binaries with no extra setup:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
GOOS=linux GOARCH=arm64 go build -o app-linux-arm64 ./...
|
docker run --rm -v "$PWD:/app" -e GOOS=linux -e GOARCH=arm64 casjaysdev/go:latest go build -o app-linux-arm64 ./...
|
||||||
GOOS=darwin GOARCH=arm64 go build -o app-darwin-arm64 ./...
|
docker run --rm -v "$PWD:/app" -e GOOS=darwin -e GOARCH=arm64 casjaysdev/go:latest go build -o app-darwin-arm64 ./...
|
||||||
GOOS=windows GOARCH=amd64 go build -o app-windows.exe ./...
|
docker run --rm -v "$PWD:/app" -e GOOS=windows -e GOARCH=amd64 casjaysdev/go:latest go build -o app-windows.exe ./...
|
||||||
GOOS=freebsd GOARCH=amd64 go build -o app-freebsd-amd64 ./...
|
docker run --rm -v "$PWD:/app" -e GOOS=freebsd -e GOARCH=amd64 casjaysdev/go:latest go build -o app-freebsd-amd64 ./...
|
||||||
```
|
```
|
||||||
|
|
||||||
Run `go tool dist list` for the full ~50-target matrix. `goreleaser` is
|
Run `docker run --rm casjaysdev/go:latest go tool dist list` for the full
|
||||||
pre-installed to orchestrate multi-platform release builds.
|
~50-target matrix. `goreleaser` is pre-installed to orchestrate multi-platform
|
||||||
|
release builds.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -261,16 +252,16 @@ pre-installed to orchestrate multi-platform release builds.
|
|||||||
### Build the image locally
|
### Build the image locally
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone https://github.com/casjaysdev/go "$HOME/Projects/github/casjaysdev/go"
|
git clone https://github.com/dockersrc/go "$HOME/Projects/github/dockersrc/go"
|
||||||
cd "$HOME/Projects/github/casjaysdev/go"
|
cd "$HOME/Projects/github/dockersrc/go"
|
||||||
docker build --tag casjaysdev/go:test .
|
docker build --tag casjaysdev/go:test .
|
||||||
```
|
```
|
||||||
|
|
||||||
### Get source files
|
### Get source files
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone "https://github.com/casjaysdev/go" \
|
git clone "https://github.com/dockersrc/go" \
|
||||||
"$HOME/Projects/github/casjaysdev/go"
|
"$HOME/Projects/github/dockersrc/go"
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user