Initial commit
[ric-plt/dbaas.git] / docker / Dockerfile.testapp
1 #   Copyright (c) 2019 AT&T Intellectual Property.
2 #   Copyright (c) 2019 Nokia.
3 #
4 #   Licensed under the Apache License, Version 2.0 (the "License");
5 #   you may not use this file except in compliance with the License.
6 #   You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #   Unless required by applicable law or agreed to in writing, software
11 #   distributed under the License is distributed on an "AS IS" BASIS,
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #   See the License for the specific language governing permissions and
14 #   limitations under the License.
15
16 FROM ubuntu:latest
17
18 # Install redis tools & golang & git
19 RUN apt-get update && \
20     apt install -y redis-tools && \
21     apt install -y git && \
22     apt install -y wget && \
23     wget https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz && \
24     tar -xvf go1.11.4.linux-amd64.tar.gz && \
25     mv go /usr/local && \
26     apt-get clean
27
28 # Copy sourcefiles
29 COPY ./testapplication ./testapplication
30
31 # Install go testapplication
32 RUN export GOROOT=/usr/local/go && \
33     export GOPATH=$HOME/Projects/Proj1 && \
34     export PATH=$GOPATH/bin:$GOROOT/bin:$PATH && \
35     go get github.com/go-redis/redis && \
36     go build /testapplication/go/testapp.go
37
38 # Keep the container alive
39 ENTRYPOINT ["tail", "-f", "/dev/null"]