Last active
September 14, 2016 18:04
-
-
Save ericksond/339c78dc0f8f6baa65a74eeb428f35c2 to your computer and use it in GitHub Desktop.
docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start a docker alpine container with exposed ports | |
docker run -d -p 6379:6379 redis:alpine | |
# Show images | |
docker images | |
# List running docker images | |
docker ps -a | |
# Inspect a docker container | |
docker container name | |
# Build a minimal docker container for Go apps | |
https://blog.codeship.com/building-minimal-docker-containers-for-go-applications/ | |
# Build with C libs | |
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . | |
Dockerfile | |
``` | |
FROM scratch | |
ADD ca-certificates.crt /etc/ssl/certs/ | |
ADD main / | |
CMD ["/main"] | |
``` | |
# Build container | |
docker build -t example-scratch -f Dockerfile.scratch . | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment