docs/docker.md

1.2 KiB
Raw Blame History

title, description, published, date, tags
title description published date tags
Docker true 2019-10-08T12:32:14.263Z

Docker

Commands

docker ps
docker-compose up -d
docker-compose down

Images

Image Status

Overview

GitHub - veggiemonk/awesome-docker: A curated list of Docker resources and projects

Building Images

Use multi-stage builds | Docker Documentation

FROM golang:1.7.3 AS builder
WORKDIR /go/src/github.com/alexellis/href-counter/
RUN go get -d -v golang.org/x/net/html  
COPY app.go    .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .

FROM alpine:latest  
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go/src/github.com/alexellis/href-counter/app .
CMD ["./app"]  

Networking

Networking in Compose | Docker Documentation

Use bridge networks | Docker Documentation

Docker Compose Bridge Networking Linux Hint