PrivateDockerfile 1.3 KB
Newer Older
1 2 3 4 5 6 7 8 9
#
# abc Dockerfile
# private: docker build --build-arg ABC_BUILD=noss -t abc .
# docker volume create --name abc
# docker run -i --rm -v abc:/root abc login google
# root is $HOME, -i for stdin, --rm to remove container
#

# Pull the base image
S
Siddharth Kothari 已提交
10
FROM golang:1.12.5 AS builder
11 12
MAINTAINER Siddharth Kothari <siddharth@appbase.io>

S
Siddharth Kothari 已提交
13 14
# Get build variant
ARG ABC_BUILD=noss
15
ENV ABC_BUILD=${ABC_BUILD}
16

17 18 19
# Use Private token for the codebase
ARG PAT

S
Siddharth Kothari 已提交
20 21 22 23 24 25 26 27 28 29
RUN apt-get update && \
	apt-get install -y libssl-dev && \
	mkdir -p $GOPATH/github.com/src/appbaseio/abc && \
	mkdir -p /abc && \
	curl -LO https://github.com/neo4j-drivers/seabolt/releases/download/v1.7.4/seabolt-1.7.4-Linux-ubuntu-18.04.deb && \
	dpkg -i seabolt-1.7.4-Linux-ubuntu-18.04.deb && \
	go get github.com/neo4j/neo4j-go-driver/neo4j && \
	go get gopkg.in/olivere/elastic.v7

WORKDIR $GOPATH/src/github.com/appbaseio/abc
30
RUN git clone https://$PAT@github.com/appbaseio-confidential/abc-import private
31

S
Siddharth Kothari 已提交
32
COPY . .
33

S
Siddharth Kothari 已提交
34
RUN go build -tags "seabolt_static $ABC_BUILD" -o /abc/abc ./cmd/abc/...
35

S
Siddharth Kothari 已提交
36 37 38 39 40 41 42
FROM ubuntu:bionic
MAINTAINER Siddharth Kothari <siddharth@appbase.io>

# certs
RUN apt-get update && \
	apt-get install -y ca-certificates && \
	update-ca-certificates
43

S
Siddharth Kothari 已提交
44
COPY --from=builder /abc/abc /abc/abc
45 46 47

# Define default entrypoint
# Entrypoint gets extra parameters from docker run
S
Siddharth Kothari 已提交
48
ENTRYPOINT ["/abc/abc"]