Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aerth/godev
go development container
https://github.com/aerth/godev
development development-environment docker golang ide tmux vim
Last synced: 3 months ago
JSON representation
go development container
- Host: GitHub
- URL: https://github.com/aerth/godev
- Owner: aerth
- Created: 2017-05-15T23:13:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-06T18:12:18.000Z (almost 5 years ago)
- Last Synced: 2024-08-05T09:12:51.573Z (6 months ago)
- Topics: development, development-environment, docker, golang, ide, tmux, vim
- Language: Dockerfile
- Homepage: https://hub.docker.com/r/aerth/godev/
- Size: 13.7 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go development container
* vim-go (auto-complete and more)
* tmux
* bash
* gcc (builds CGO programs against musl lib)### debugging tools
* dlv
* valgrind
* gdb
* file### usage
By default, GoDev creates a directory to be shared with the container in `./data`, relative to current working directory. You may want to change this behavior.
You can also edit the launcher script to add port forwarding etc
Change line 2 of the GoDev launcher script to this:
`GODEV_SHARED_DIR=$PWD`
Or always use the same directory, regardless of from where it is being ran.
`export GODEV_SHARED_DIR=$HOME/src`
Note: since you are user `root` in the container, we `chown` the shared dirctory when exiting the session. This could take a while or lead to unexpected results if the shared directory is not even owned by the user, for example, `/`.
It's safer to use a dedicated shared directory such as `$PWD/data` by using the GODEV_SHARED_DIR variable in ~/.bashrc or editing the GoDev launcher script.
### installation
* `wget -O GoDev https://raw.githubusercontent.com/aerth/godev/master/GoDev`
* `chmod +x GoDev`finally, move `GoDev` to `/usr/local/bin/` or somewhere in `$PATH`
### notes
No point setting `CGO_ENABLED=0` by default.
To make static compiled non-cgo programs:* `export CGO_ENABLED=0`
Or:
* `export GOFLAGS=-tags=osusergo,netgo`
Or if using CGO, something like this in your Makefile
```
buildflags += --ldflags '-linkmode external -extldflags "-static"'
test:
go build -v $(buildflags) -o $@
```The image comes out to 1.25 GB