Skip to content

Commit

Permalink
Merge pull request #2023 from weaveworks/add-opencontainers-labels-to…
Browse files Browse the repository at this point in the history
…-dockerfiles

 Add org.opencontainers.image.* labels to Dockerfiles
  • Loading branch information
marccarre authored May 10, 2018
2 parents 5214175 + 5c619d0 commit a7be217
Show file tree
Hide file tree
Showing 26 changed files with 185 additions and 46 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
# All this must go at top of file I'm afraid.
IMAGE_PREFIX := quay.io/weaveworks
IMAGE_TAG := $(shell ./tools/image-tag)
GIT_REVISION := $(shell git rev-parse --short HEAD)
UPTODATE := .uptodate

# Building Docker images is now automated. The convention is every directory
# with a Dockerfile in it builds an image calls quay.io/weaveworks/<dirname>.
# Dependencies (i.e. things that go in the image) still need to be explicitly
# declared.
%/$(UPTODATE): %/Dockerfile
$(SUDO) docker build -t $(IMAGE_PREFIX)/$(shell basename $(@D)) $(@D)/
$(SUDO) docker build --build-arg=revision=$(GIT_REVISION) -t $(IMAGE_PREFIX)/$(shell basename $(@D)) $(@D)/
$(SUDO) docker tag $(IMAGE_PREFIX)/$(shell basename $(@D)) $(IMAGE_PREFIX)/$(shell basename $(@D)):$(IMAGE_TAG)
touch $@

Expand Down Expand Up @@ -317,7 +318,7 @@ gcp-service-integration-test: gcp-service/$(UPTODATE) gcp-service/grpc/gcp-servi
exit $$status

notification-integration-test:
docker build -f notification-eventmanager/integrationtest/Dockerfile.integration -t notification-integrationtest .
docker build --build-arg=revision=$(GIT_REVISION) -f notification-eventmanager/integrationtest/Dockerfile.integration -t notification-integrationtest .
cd notification-eventmanager/integrationtest && $(SUDO) docker-compose up --abort-on-container-exit; EXIT_CODE=$$?; $(SUDO) docker-compose down; exit $$EXIT_CODE

clean:
Expand Down
8 changes: 7 additions & 1 deletion authfe/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
FROM alpine:3.6
MAINTAINER Weaveworks Inc <[email protected]>
WORKDIR /
COPY authfe /
COPY ca-certificates.crt /etc/ssl/certs/
EXPOSE 80
ENTRYPOINT ["/authfe"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="authfe" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/authfe" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
7 changes: 7 additions & 0 deletions billing-aggregator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ RUN apk add --update \
&& rm -rf /var/cache/apk/*
ADD migrations /migrations
ADD aggregator /

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="billing-aggregator" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/billing-aggregator" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
7 changes: 7 additions & 0 deletions billing-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ RUN apk add --update \
&& rm -rf /var/cache/apk/*
ADD db/migrations /migrations
ADD api /

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="billing-api" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/billing-api" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
7 changes: 7 additions & 0 deletions billing-enforcer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ RUN apk add --update \
ca-certificates \
&& rm -rf /var/cache/apk/*
ADD enforcer /

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="billing-enforcer" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/billing-enforcer" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
9 changes: 8 additions & 1 deletion billing-hpm_demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
FROM httpd:2.4-alpine
COPY . /usr/local/apache2/htdocs/
COPY . /usr/local/apache2/htdocs/

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="billing-hpm_demo" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/billing-hpm_demo" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
9 changes: 8 additions & 1 deletion billing-ingester/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM fluent/fluentd:v0.12.40
MAINTAINER [email protected]

USER root

# Install fluent-plugin-prometheus for fluentd 0.12
Expand All @@ -25,3 +25,10 @@ COPY fluent-dev.conf /fluentd/etc/
COPY fluent.conf /fluentd/etc/
EXPOSE 24225
EXPOSE 24231

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="billing-ingester" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/billing-ingester" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
7 changes: 7 additions & 0 deletions billing-uploader/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ RUN apk add --update \
&& rm -rf /var/cache/apk/*
ADD migrations /migrations
ADD uploader /

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="billing-uploader" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/billing-uploader" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
7 changes: 7 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ RUN mkdir protoc && \
RUN go get github.com/golang/mock/mockgen
COPY build.sh /
ENTRYPOINT ["/build.sh"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="build" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/build" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
15 changes: 8 additions & 7 deletions dashboard-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM alpine:3.7
MAINTAINER Weaveworks Inc <[email protected]>
LABEL org.label-schema.name="dashboard-api" \
org.label-schema.description="serve service dashboards" \
org.label-schema.vcs-url="https://github.com/weaveworks/service/tree/master/dashboard-service" \
org.label-schema.vendor="Weaveworks" \
org.label-schema.schema-version="1.0"

WORKDIR /
COPY dashboard-api /
EXPOSE 80
EXPOSE 4772
ENTRYPOINT ["/dashboard-api"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="dashboard-api" \
org.opencontainers.image.description="serve service dashboards" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/dashboard-api" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
8 changes: 7 additions & 1 deletion fluentd-loggly/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM fluent/fluentd:v0.14.20-debian

USER root
RUN buildDeps="sudo make gcc g++ libc-dev ruby-dev autoconf automake libtool libltdl-dev" \
&& apt-get update \
Expand All @@ -21,3 +20,10 @@ RUN buildDeps="sudo make gcc g++ libc-dev ruby-dev autoconf automake libtool lib
$buildDeps \
&& rm -rf /var/lib/apt/lists/* \
/home/fluent/.gem/ruby/2.3.0/cache/*.gem

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="fluentd-loggly" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/fluentd-loggly" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
16 changes: 8 additions & 8 deletions flux-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM alpine:3.7

MAINTAINER Weaveworks Inc <[email protected]>
LABEL org.label-schema.name="flux-api" \
org.label-schema.description="service to provide Deploy (Flux) API" \
org.label-schema.vcs-url="https://github.com/weaveworks/service/tree/master/flux-api" \
org.label-schema.vendor="Weaveworks" \
org.label-schema.schema-version="1.0"

WORKDIR /home/flux
ENTRYPOINT [ "/sbin/tini", "--", "flux-api" ]
RUN apk add --no-cache ca-certificates tini
ADD migrations.tar /home/flux
COPY flux-api /usr/local/bin/

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="flux-api" \
org.opencontainers.image.description="service to provide Deploy (Flux) API" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/flux-api" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
8 changes: 7 additions & 1 deletion gcp-launcher-webhook/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
FROM alpine:3.6
MAINTAINER Weaveworks Inc <[email protected]>
WORKDIR /
COPY gcp-launcher-webhook /
COPY ca-certificates.crt /etc/ssl/certs/
EXPOSE 80
ENTRYPOINT ["/gcp-launcher-webhook"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="gcp-launcher-webhook" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/gcp-launcher-webhook" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
15 changes: 8 additions & 7 deletions gcp-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM alpine:3.7
MAINTAINER Weaveworks Inc <[email protected]>
LABEL org.label-schema.name="gcp-service" \
org.label-schema.description="service to interact with GCP's APIs" \
org.label-schema.vcs-url="https://github.com/weaveworks/service/tree/master/gcp-service" \
org.label-schema.vendor="Weaveworks" \
org.label-schema.schema-version="1.0"

RUN apk add --no-cache -q ca-certificates
WORKDIR /
COPY gcp-service /
EXPOSE 80
EXPOSE 4772
ENTRYPOINT ["/gcp-service"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="gcp-service" \
org.opencontainers.image.description="service to interact with GCP's APIs" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/gcp-service" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
8 changes: 7 additions & 1 deletion github-receiver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM alpine:3.6
MAINTAINER Weaveworks Inc <[email protected]>
WORKDIR /
COPY github-receiver /
EXPOSE 80
ENTRYPOINT ["/github-receiver"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="github-receiver" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/github-receiver" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
15 changes: 8 additions & 7 deletions kubectl-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
FROM alpine:3.7
MAINTAINER Weaveworks Inc <[email protected]>
LABEL org.label-schema.name="kubectl-service" \
org.label-schema.description="multi-version kubectl-as-a-service" \
org.label-schema.vcs-url="https://github.com/weaveworks/service/tree/master/kubectl-service" \
org.label-schema.vendor="Weaveworks" \
org.label-schema.schema-version="1.0"

RUN apk add --no-cache -q ca-certificates

RUN mkdir kubectl
Expand Down Expand Up @@ -48,3 +41,11 @@ COPY kubectl-service /
EXPOSE 80
EXPOSE 4772
ENTRYPOINT ["/kubectl-service"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="kubectl-service" \
org.opencontainers.image.description="multi-version kubectl-as-a-service" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/kubectl-service" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
8 changes: 7 additions & 1 deletion logging/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM fluent/fluentd:v0.12.24
MAINTAINER [email protected]
USER root
RUN \
apk add --no-cache --update g++ make ruby-dev && \
Expand All @@ -8,3 +7,10 @@ RUN \
COPY schema_service_events.json /bigquery/
# fluent.conf is copied by a Dockerfile Build Trigger
COPY fluent-dev.conf /fluentd/etc/

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="logging" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/logging" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
8 changes: 7 additions & 1 deletion metrics/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
FROM alpine:3.6
MAINTAINER Weaveworks Inc <[email protected]>
WORKDIR /
COPY metrics /
ENTRYPOINT ["/metrics"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="metrics" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/metrics" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
8 changes: 7 additions & 1 deletion notebooks/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
FROM alpine:3.6
MAINTAINER Weaveworks Inc <[email protected]>
WORKDIR /
COPY cmd/notebooks/notebooks /
COPY db/migrations /migrations/
EXPOSE 80
ENTRYPOINT ["/notebooks"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="notebooks" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/notebooks" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
8 changes: 7 additions & 1 deletion notification-eventmanager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
FROM alpine:3.6
MAINTAINER Weaveworks Inc <[email protected]>
RUN apk add --no-cache ca-certificates
WORKDIR /
COPY cmd/eventmanager/eventmanager /
COPY db/migrations /migrations
EXPOSE 80
ENTRYPOINT ["/eventmanager"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="notification-eventmanager" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/notification-eventmanager" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
FROM quay.io/weaveworks/build
MAINTAINER Weaveworks Inc <[email protected]>
WORKDIR /
COPY . /go/src/github.com/weaveworks/service
RUN go install github.com/weaveworks/service/notification-eventmanager/integrationtest
EXPOSE 80
ENTRYPOINT ["/go/bin/integrationtest"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="notification-eventmanager-integrationtest" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/notification-eventmanager/integrationtest" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
9 changes: 8 additions & 1 deletion notification-sender/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
FROM alpine:3.6
MAINTAINER Weaveworks Inc <[email protected]>

RUN apk add --no-cache ca-certificates
WORKDIR /
COPY cmd/sender/sender /
EXPOSE 80
ENTRYPOINT ["/sender"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="notification-sender" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/notification-sender" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
7 changes: 7 additions & 0 deletions postgres-configs-db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
FROM postgres:9.6
ENV POSTGRES_DB configs
ADD init.sql /docker-entrypoint-initdb.d/

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="billing-api" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/postgres-configs-db" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
8 changes: 7 additions & 1 deletion service-ui-kicker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
FROM node:8.4.0-alpine
MAINTAINER Weaveworks Inc <[email protected]>
RUN apk add --no-cache python make gcc g++ git openssh
RUN git config --global user.email "[email protected]"
ENV GIT_SSH_COMMAND "ssh -oStrictHostKeyChecking=no"
WORKDIR /
COPY service-ui-kicker /
EXPOSE 80
ENTRYPOINT ["/service-ui-kicker"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="service-ui-kicker" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/service-ui-kicker" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
8 changes: 7 additions & 1 deletion tools/socks/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
FROM gliderlabs/alpine
MAINTAINER Weaveworks Inc <[email protected]>
WORKDIR /
COPY proxy /
EXPOSE 8000
EXPOSE 8080
ENTRYPOINT ["/proxy"]

ARG revision
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="authfe" \
org.opencontainers.image.source="https://github.com/weaveworks/service/tree/master/authfe" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.vendor="Weaveworks"
Loading

0 comments on commit a7be217

Please sign in to comment.