Skip to content

Commit

Permalink
Merge pull request #31 from codefornola/docker-image-versioning
Browse files Browse the repository at this point in the history
Attempt to use Docker Hub-supported env vars to version image.
  • Loading branch information
nihonjinrxs committed Mar 20, 2018
2 parents e314396 + a8285a4 commit efcff34
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 311 app

[![](https://images.microbadger.com/badges/image/codefornola/311.svg)](https://microbadger.com/images/codefornola/311 "Get your own image badge on microbadger.com")[![](https://images.microbadger.com/badges/version/codefornola/311.svg)](https://microbadger.com/images/codefornola/311 "Get your own version badge on microbadger.com")
**Docker Image** [![](https://images.microbadger.com/badges/image/codefornola/311.svg)](https://microbadger.com/images/codefornola/311 "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/version/codefornola/311.svg)](https://microbadger.com/images/codefornola/311 "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/commit/codefornola/311.svg)](https://microbadger.com/images/codefornola/311 "Get your own commit badge on microbadger.com")

We want to build something better than the default Socrata 311 site:
https://311explorer.nola.gov/main/category/
Expand Down
7 changes: 7 additions & 0 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
FROM node
ARG BUILD_DATE
ARG VCS_REF
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/codefornola/311.git" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.schema-version="1.0.0-rc1" \
org.codeforneworleans.app-name="311 Explorer"
WORKDIR /usr/src/app
COPY package.json .
RUN npm install
Expand Down
3 changes: 3 additions & 0 deletions app/hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
# $IMAGE_NAME var is injected into the build so the tag is correct.
docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` -t $IMAGE_NAME .

0 comments on commit efcff34

Please sign in to comment.