Docker
- [[Podman]]
- [[Kubernetes]]
- [[Docker-Compose]]
Examples
docker run --rm -it ubuntu:latest bash
- Expose port container:8080 on host:80:
docker run --rm -it -p 80:8080 ubuntu:latest bash
docker run --rm -it -v /local/path:/mount/path ubuntu:latest bash
- Get a Docker Image and specify platform:
docker run --rm -ti --platform linux/amd64 ubuntu:latest bash
Capabilities
Dockerfile
Multi-Stage Builds
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"]
NFS
- Mount an NFS Volume with Docker Compose
version: '2'
volumes:
nfs_volume_name:
driver: local
driver_opts:
type: nfs4
o: "addr=192.168.0.xxx,rw,noatime,rsize=8192,wsize=8192,tcp,timeo=14"
device: ":path/to/volume"
services:
image_name:
image: "image:latest"
volumes:
- nfs_volume_name:/data/test_nfs
version: "3.2"
services:
rsyslog:
image: jumanjiman/rsyslog
ports:
- "514:514"
- "514:514/udp"
volumes:
- type: volume
source: example
target: /nfs
volume:
nocopy: true
volumes:
example:
driver_opts:
type: "nfs"
o: "addr=10.40.0.199,nolock,soft,rw"
device: ":/docker/example"
Docker Compose
Registry
Network