From d6fe8f67989558b2ac4a25f4e22f19d4415b0dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 18 Nov 2019 14:35:00 +0100 Subject: [PATCH 1/2] Remove build stage from Dockerfile - builds are done in drone --- Dockerfile | 16 ++-------------- Makefile.release | 5 ++++- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a6348f1e68..331e764f890 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,3 @@ -# build stage -FROM node:10.15.3-alpine as build-stage -RUN apk update && apk upgrade && \ - apk add --no-cache bash git +FROM webhippie/nginx:latest -WORKDIR /app -COPY . . -RUN yarn install -RUN yarn dist - -# production stage -FROM nginx:1.13.12-alpine as production-stage -COPY --from=build-stage /app/dist /usr/share/nginx/html -EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] +COPY dist /srv/www diff --git a/Makefile.release b/Makefile.release index c5c9d48a560..322f7c0e88f 100644 --- a/Makefile.release +++ b/Makefile.release @@ -35,7 +35,7 @@ help: .PHONY: dist dist: ## Build distribution -dist: distdir javascript oc-app distconf sign package +dist: distdir javascript oc-app distconf sign package docker-image .PHONY: javascript @@ -74,3 +74,6 @@ package: cp -R $(dist_dir) $(CURDIR)/phoenix tar -czf $(CURDIR)/release/$(app_name).tar.gz -C $(CURDIR) phoenix +.PHONY: docker-image +docker-image: + docker build . From 297f5da4ff0a2e88e03673cc4b75b8c083158d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 18 Nov 2019 15:18:55 +0100 Subject: [PATCH 2/2] Push docker image to docker hub --- .drone.starlark | 4 +++- .drone.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.drone.starlark b/.drone.starlark index 34ae9ace60d..5376cd73b82 100644 --- a/.drone.starlark +++ b/.drone.starlark @@ -566,7 +566,9 @@ def buildDockerImage(): 'DOCKER_HOST': 'tcp://docker:2375' }, 'commands': [ - 'docker build -t owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} .' + 'docker build -t owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} .', + 'docker tag owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} owncloud/phoenix:latest', + 'docker push owncloud/phoenix:latest' ], 'when': { 'event': [ diff --git a/.drone.yml b/.drone.yml index 24a934cfb39..2533bdd2588 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4963,6 +4963,8 @@ steps: image: toolhippie/docker:latest commands: - docker build -t owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} . + - docker tag owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} owncloud/phoenix:latest + - docker push owncloud/phoenix:latest environment: DOCKER_HOST: tcp://docker:2375 when: