Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

Commit d0e6593

Browse files
authored
Merge pull request #20 from adam-stanek/docker-split
Split docker files
2 parents 0173f0b + f1e72a3 commit d0e6593

File tree

5 files changed

+46
-40
lines changed

5 files changed

+46
-40
lines changed

Dockerfile

Lines changed: 0 additions & 19 deletions
This file was deleted.

Dockerfile.email

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM golang:1.15-buster AS build
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends bash curl git ca-certificates
4+
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
5+
6+
WORKDIR /go/src/github.com/analogj/lodestone-publisher/
7+
8+
ADD Gopkg.toml ./
9+
ADD Gopkg.lock ./
10+
ADD cmd ./cmd
11+
ADD pkg ./pkg
12+
13+
RUN dep ensure
14+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/lodestone-email-publisher ./cmd/email-publisher/email-publisher.go
15+
RUN mkdir tmp
16+
17+
FROM scratch
18+
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
19+
COPY --from=build /go/src/github.com/analogj/lodestone-publisher/tmp /tmp
20+
COPY --from=build /go/src/github.com/analogj/lodestone-publisher/bin/lodestone-email-publisher /lodestone-email-publisher
21+
CMD ["/lodestone-email-publisher"]

Dockerfile.fs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM golang:1.15-buster AS build
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends bash curl git
4+
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
5+
6+
WORKDIR /go/src/github.com/analogj/lodestone-publisher/
7+
8+
ADD Gopkg.toml ./
9+
ADD Gopkg.lock ./
10+
ADD cmd ./cmd
11+
ADD pkg ./pkg
12+
13+
RUN dep ensure
14+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o lodestone-fs-publisher ./cmd/fs-publisher/fs-publisher.go
15+
16+
FROM scratch
17+
COPY --from=build /go/src/github.com/analogj/lodestone-publisher/lodestone-fs-publisher /lodestone-fs-publisher
18+
CMD ["/lodestone-fs-publisher"]

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# lodestone-publisher
22

33

4-
# Local Development
4+
# How to build
55

6-
```
7-
docker build --tag=lodestone-publisher .
8-
docker run -v `pwd`:/go/src/github.com/analogj/lodestone-publisher/ lodestone-publisher
6+
```bash
7+
docker build -f Dockerfile.fs -t lodestone-fs-publisher .
8+
docker run lodestone-fs-publisher
99

10+
docker build -f Dockerfile.email -t lodestone-email-publisher .
11+
docker run lodestone-email-processor
1012
```
13+

packagr.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)