Skip to content

Commit

Permalink
fix(docker): remove dependency on NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Dec 12, 2019
1 parent 027d4b6 commit d3a8050
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 37 deletions.
33 changes: 2 additions & 31 deletions packages/cosmic-swingset/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# The Golang build container.
FROM golang:stretch AS go-build
# TODO This should be split out into the cosmos-connector.
FROM golang:stretch

WORKDIR /usr/src/app
COPY Makefile* *.go go.* ./
Expand All @@ -9,33 +10,3 @@ COPY lib/*.go lib/
COPY lib/daemon/ lib/daemon/
COPY lib/helper/ lib/helper/
RUN make compile-go install

# The Node build container
FROM node:stretch AS node-build

WORKDIR /usr/src/app
RUN mkdir lib
COPY lib/*.cc lib/
COPY package*.json *.gyp *.tgz ./
RUN echo 'all:' > Makefile
COPY --from=go-build /usr/src/app/lib/*.so /usr/src/app/lib/*.h ./lib/
RUN npm install && npm run build

# The install container
FROM node:stretch AS install

WORKDIR /usr/src/app
COPY lib/ lib/
COPY --from=go-build /usr/src/app/lib/ lib/
RUN mkdir -p build/Release
COPY ssh-tunnel /ssh-tunnel
COPY package*.json *.tgz ./
COPY demo1/ ./demo1/
COPY bin/ ./bin/
RUN npm install --production
COPY --from=node-build /usr/src/app/build/Release/*.node build/Release/
COPY --from=go-build /go/bin/ag-cosmos-helper /usr/local/bin/

# By default, run the daemon with specified arguments.
EXPOSE 26657
ENTRYPOINT [ "./lib/ag-chain-cosmos" ]
10 changes: 5 additions & 5 deletions packages/deployment/Dockerfile.sdk
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# The Node install container
FROM agoric/cosmic-swingset:latest
# The install container
FROM node:stretch AS install

WORKDIR /usr/src/agoric-sdk
COPY . .
RUN (cd packages/cosmic-swingset && tar -cf - .) | (cd ../app && tar -xBpf -) && \
rm -rf packages/cosmic-swingset && mv ../app packages/cosmic-swingset && \
ln -s agoric-sdk/packages/cosmic-swingset ../app
COPY --from=agoric/cosmic-swingset-go:latest /usr/src/app/lib/ packages/cosmic-swingset/lib/
COPY --from=agoric/cosmic-swingset-go:latest /go/bin/ag-cosmos-helper /usr/local/bin/
RUN ln -s agoric-sdk/packages/cosmic-swingset ../app
RUN echo 'all:' > packages/cosmic-swingset/Makefile

RUN yarn install
Expand Down
2 changes: 1 addition & 1 deletion packages/deployment/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ docker-build-base:
hash=`git rev-parse --short HEAD`; \
dirty=`git diff --quiet || echo -dirty`; \
echo "$$hash$$dirty" > $(SS)lib/git-revision.txt
docker build -t $(REPOSITORY):latest $(SS)
docker build -t $(REPOSITORY)-go:latest $(SS)

docker-build-pserver:
docker build -t $(REPOSITORY)-pserver:latest $(SS)provisioning-server
Expand Down

0 comments on commit d3a8050

Please sign in to comment.