Skip to content

Commit

Permalink
[cw|frenata#5] recover from merging master into this branch >_<
Browse files Browse the repository at this point in the history
Major Changes:
* rename dockerfiles
* adjust docker-compose
* adjust Dockerfile-server
  • Loading branch information
connorwalsh committed Mar 10, 2018
1 parent 631d274 commit 5123e0b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
28 changes: 10 additions & 18 deletions Dockerfile~HEAD → Dockerfile-server
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,29 @@ FROM golang:1.9-alpine as server
# GOPATH = /go in the golang image
# also $GOPATH/bin has been added to path

WORKDIR /go/src/
WORKDIR /go/src/github.com/frenata/compilebox

# copy API server src to be compiled
COPY API/ ./

# currently, we need to install several dependencies
# note that we must install Docker, but when we run the container, we must
# mount the /var/run/docker.sock of the host onto the container so the host
# docker daemon spins up sibling containers (as opposed to Docker in Docker)
#
# TODO (cw|3.9.18) once we remove the dependency on gb, we will only need to
# install docker here.
RUN apk update && \
apk add --no-cache git && \
go get github.com/constabulary/gb/... && \
apk del git && \
apk add docker
COPY . .

# compile and install server binary within container
RUN gb build && \
mv ./bin/compilebox /go/bin
RUN go install ./cmd/compilebox

FROM alpine

WORKDIR /bin/

# note that we must install Docker, but when we run the container, we must
# mount the /var/run/docker.sock of the host onto the container so the host
# docker daemon spins up sibling containers (as opposed to Docker in Docker)
RUN apk update && \
apk add docker

# copy over single binary from build stage --^
COPY --from=server /go/bin/compilebox .

# copy compilers data
COPY ./API/data/compilers.json ./data/compilers.json
COPY ./data/compilers.json ./data/compilers.json

# run comilebox API server
CMD ["compilebox"]
File renamed without changes.
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
compilebox_api_server:
build:
context: .
dockerfile: Dockerfile-server
env_file: .env
volumes:
- /var/run/docker.sock:/var/run/docker.sock # use host Docker daemon
Expand All @@ -13,5 +14,6 @@ services:
compilebox:
env_file: .env
build:
context: ./Setup/
context: .
dockerfile: Dockerfile-vm
command: echo "compilebox build complete"

0 comments on commit 5123e0b

Please sign in to comment.