docker: use nodejs 6.10.0

- Pull Node version from .nvmrc
- Migrate passwords out of .travis.yml
This commit is contained in:
Oskar Pearson
2017-03-19 21:54:06 +00:00
parent 4e7d5e721e
commit f9c208b54a
3 changed files with 8 additions and 9 deletions
+6 -1
View File
@@ -50,10 +50,14 @@ travis:
docker_release:
# Get the version from the package.json file
$(eval DOCKER_TAG=$(shell cat package.json | jq '.version' | tr -d '"'))
$(eval NODE_VERSION=$(shell cat .nvmrc))
#
# Create a Dockerfile that contains the correct NodeJS version
cat Dockerfile.example | sed -e "s/^FROM node:.*/FROM node:${NODE_VERSION}/" > Dockerfile
#
# Rebuild the image. We do this with no-cache so that we have all security upgrades,
# since that's more important than fewer layers in the Docker image.
docker build --no-cache=true -f Dockerfile.example -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
docker build --no-cache=true -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
# Push an image to Docker Hub with the version from package.json:
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
#
@@ -68,5 +72,6 @@ docker_release:
docker tag $(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKER_IMAGE):latest_dev && \
docker push $(DOCKER_IMAGE):latest_dev; \
fi
rm -f Dockerfile
.PHONY: all coverage docker_release report test travis