View Dockerfile
FROM alpine:3.4
ARG FOO
ADD test.sh .
RUN ./test.sh
View my-awesome-sizes.txt
udacity/my-awesome 1.0 7.162 MB
udacity/my-awesome big 251.2 MB
View build.sh
# switches and options:
# --rm : remove volume
# -v : volume mount build folder
# -w : set work area to build folder
# /bin/sh : build script
docker run --rm \
-v $(pwd):/go/src/github.com/udacity/my-awesome \
-w /go/src/github.com/udacity/my-awesome \
golang:1.5-alpine \
/bin/sh -c 'apk add --update git; go get; go build -o target/my-awesome .'
View 1.0.dockerfile
FROM alpine:3.3
COPY target/my-awesome /usr/local/bin/my-awesome
CMD ["my-awesome"]
View big.dockerfile
# golang:1.5-alpine includes the go compiler
FROM golang:1.5-alpine
# Add build tools needed by go get
RUN apk add --update git
# Add source code
COPY . /go/src/github.com/udacity/my-awesome
WORKDIR /go/src/github.com/udacity/my-awesome
View without_cached_history.shell
$ docker build -t without_cached -f without_cached.dockerfile .
[...]
$ docker history without_cached
IMAGE CREATED CREATED BY SIZE COMMENT
19b3d76d50f5 3 weeks ago /bin/sh -c apk add --update curl drill && rm 2.26 MB
70c557e50ed6 6 weeks ago /bin/sh -c #(nop) ADD file:81ba6f20bdb99e6c13 4.794 MB
View without_cached.dockerfile
FROM alpine:3.3
RUN apk add --update curl drill \
&& rm -rf /var/cache/apk/*
View extra_layers.dockerfile
FROM alpine:3.3
RUN apk add --update curl drill
# cleanup index package cache since this is dead weight
# that should not be deployed
RUN rm -rf /var/cache/apk/*
View docker_history.shell
$ docker build -t extra_layers -f extra_layers.dockerfile .
[...]
$ docker history extra_layers
IMAGE CREATED CREATED BY SIZE COMMENT
6c6fffb28c43 3 weeks ago /bin/sh -c rm -rf /var/cache/apk/* 0 B
636b0662bc76 3 weeks ago /bin/sh -c apk add --update curl drill 3.009 MB
70c557e50ed6 6 weeks ago /bin/sh -c #(nop) ADD file:81ba6f20bdb99e6c13 4.794 MB
View screen-time.sh
#!/usr/bin/env bash
#params
# dd_api_key=
# dd_app_key=
# screen_id=
curl -sX GET "https://app.datadoghq.com/api/v1/screen/${screen_id}?api_key=${dd_api_key}&application_key=${dd_app_key}" \
| jq '{
title: .board_title,
description: .board_title,
template_variables: .template_variables,