Skip to content

Commit

Permalink
Merge pull request #3078 from jacekn/friendbot_docker
Browse files Browse the repository at this point in the history
Add friendbot Dockerfile and Makefile
  • Loading branch information
jacekn authored Oct 2, 2020
2 parents 6323e73 + 2cd69a2 commit 5c62e03
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ keystore:
ticker:
$(MAKE) -C services/ticker/ docker-build

friendbot:
$(MAKE) -C services/friendbot/ docker-build

webauth:
$(MAKE) -C exp/services/webauth/ docker-build

Expand Down
13 changes: 13 additions & 0 deletions services/friendbot/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Check if we need to prepend docker commands with sudo
SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo")

# If TAG is not provided set default value
TAG ?= stellar/friendbot:$(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n))

docker-build:
cd ../../ && \
$(SUDO) docker build -f services/friendbot/docker/Dockerfile -t $(TAG) .

docker-push:
cd ../../ && \
$(SUDO) docker push $(TAG)
12 changes: 12 additions & 0 deletions services/friendbot/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.14-stretch as build

ADD . /src/friendbot
WORKDIR /src/friendbot
RUN go build -o /bin/friendbot ./services/friendbot

FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
COPY --from=build /bin/friendbot /app/
EXPOSE 8004
ENTRYPOINT ["/app/friendbot"]

0 comments on commit 5c62e03

Please sign in to comment.