Skip to content

Commit

Permalink
build: enable multiple Dockerfiles (cs3org#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode authored Aug 22, 2019
1 parent 5f67993 commit da2ed56
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 11 deletions.
28 changes: 28 additions & 0 deletions Dockerfile.reva
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2018-2019 CERN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# In applying this license, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

FROM golang:1.11

WORKDIR /go/src/github/cs3org/reva
COPY . .
RUN GO111MODULE=off make deps
ENV GO111MODULE=on
RUN make build-reva
WORKDIR /go/src/github/cs3org/reva/cmd/reva
RUN go install
ENTRYPOINT ["/go/bin/reva"]
4 changes: 2 additions & 2 deletions Dockerfile → Dockerfile.revad
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

FROM golang:1.11

ENV GO111MODULE=on
WORKDIR /go/src/github/cs3org/reva
COPY . .
RUN GO111MODULE=off make deps
RUN make
ENV GO111MODULE=on
RUN make build-revad
WORKDIR /go/src/github/cs3org/reva/cmd/revad
RUN go install
RUN mkdir -p /etc/revad/
Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ build:
go build -o ./cmd/revad/revad ${LDFLAGS} ./cmd/revad
go build -o ./cmd/reva/reva ${LDFLAGS} ./cmd/reva

build-revad:
go build ./...
go mod tidy
go build -o ./cmd/revad/revad ${LDFLAGS} ./cmd/revad

build-reva:
go build ./...
go mod tidy
go build -o ./cmd/revad/revad ${LDFLAGS} ./cmd/revad

test:
go test -race ./...

Expand All @@ -37,5 +47,5 @@ deploy:
./cmd/revad/revad -c ./cmd/revad/revad.toml -p ./cmd/revad/revad.pid
deps:
cd /tmp && go get -u golang.org/x/lint/golint
cd /tmp && GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.17.1
cd /tmp && go get github.com/golangci/golangci-lint/cmd/golangci-lint
cd /tmp && go get -u golang.org/x/tools/cmd/goimports
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@ You can also read the [build from sources guide](https://cs3org.github.io/reva/b

## Run it using Docker

```
$ git clone https://github.com/cs3org/reva
$ cd reva
$ docker build . -t revad
$ docker run -p 9999:9999 -p 9998:9998 -d revad
# or provide your own config
# $ docker run -p 9999:9999 -p 9998:9998 -v /your/config:/etc/revad/revad.toml -d revad
```
See [https://hub.docker.com/r/cs3org/reva](https://hub.docker.com/r/cs3org/reva).

## Plugin development

Expand Down

0 comments on commit da2ed56

Please sign in to comment.