Skip to content

Instantly share code, notes, and snippets.

@Integralist
Last active March 14, 2024 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Integralist/d7def72bd3c20e0e076b90b2e90233b7 to your computer and use it in GitHub Desktop.
Save Integralist/d7def72bd3c20e0e076b90b2e90233b7 to your computer and use it in GitHub Desktop.
[Docker Go Image with mounted files] #docker #go #golang #image #container #mount

Start with a Dockerfile:

FROM golang:latest

RUN apt-get update -y && apt-get install git -y

CMD ["/bin/bash"]

Build the Dockerfile into an image:

docker build -t go-and-git .

Run the Docker image as a container:

docker run -it -v /Users/integralist/Code/fastly/cli/dist/linux_linux_arm64/fastly:/go/fastly go-and-git

NOTE: The default working directory is /go as setup by the Go base image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment