Skip to content

Instantly share code, notes, and snippets.

@phuctm97
Last active September 7, 2019 14:04
Show Gist options
  • Save phuctm97/249b44be2966f059c16208481ab37a0e to your computer and use it in GitHub Desktop.
Save phuctm97/249b44be2966f059c16208481ab37a0e to your computer and use it in GitHub Desktop.
Go RESTful series
#!/bin/bash
# Get repo absolute location for mounting into the container.
local_workdir=$(cd $(dirname $(dirname "${BASH_SOURCE[0]}")) >/dev/null 2>&1 && pwd)
main() {
# Working directory inside the container.
local container_workdir=/go/src/github.com/the-evengers/go-restful
# Identifying container name.
local container_name=go-restful
docker run --rm -it \
--name $container_name \
--volume $local_workdir:$container_workdir \
--workdir $container_workdir \
golang
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment