From 4fafb96bbb5b7a7671d707f19302c89550d7abc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Mu=CC=88ller?= Date: Tue, 6 Oct 2020 11:45:47 +0200 Subject: [PATCH] Adds Dockerfile for building a local development image Add image builder documentation Fix list item indent Fix codacy issues Make alpine version explicit Fix markup indents Fix image tag Remove list items from markdown --- Dockerfile | 32 ++++++++++++++++++++++++++++++++ README.md | 19 ++++++++++++++++--- 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..0c3f5d9c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM golang:alpine as build + +COPY ./ /ocis/ +ENV CGO_ENABLED=0 +ENV GOOS=linux + +RUN apk update && \ + apk upgrade && \ + apk add make gcc bash && \ + rm -rf /var/cache/apk/* + +WORKDIR /ocis/ocis +RUN make clean generate build + + +FROM amd64/alpine:3 + +RUN apk update && \ + apk upgrade && \ + apk add ca-certificates mailcap && \ + rm -rf /var/cache/apk/* && \ + echo 'hosts: files dns' >| /etc/nsswitch.conf + +LABEL maintainer="ownCloud GmbH " \ + org.label-schema.name="ownCloud Infinite Scale" \ + org.label-schema.vendor="ownCloud GmbH" \ + org.label-schema.schema-version="1.0" + +ENTRYPOINT ["/usr/bin/ocis"] +CMD ["server"] + +COPY --from=build /ocis/ocis/bin/ocis /usr/bin/ocis \ No newline at end of file diff --git a/README.md b/README.md index 90ee4d939..160bfb7da 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,6 @@ mkdir -p /var/tmp/reva/root/{home,oc} ## Quickstart - Make sure that the binary was built with the above steps. - - Now start all services with the following command ```console @@ -57,9 +56,7 @@ mkdir -p /var/tmp/reva/root/{home,oc} ``` - Open - - Accept the self-signed certificate (it is regenerated every time the server starts) - - Login using one of the demo accounts: ```console @@ -68,6 +65,22 @@ marie:radioactivity richard:superfluidity ``` +## Create a local Docker image for testing + +Navigate into the root folder of the repository and execute + +```console +docker build -t owncloud/ocis:dev . +``` + +To run it, execute + +```console +docker run --rm -ti owncloud/ocis:dev +``` + +The image can be tagged however you like, just make sure you run the right one then + ## Running single extensions The list of available extensions can be found in the "Extensions" section when running `./bin/ocis`.