Commit 2c5bd41b authored by Adrian's avatar Adrian

[fix] Refactored Dockerfiles

parent ccd98811
...@@ -15,5 +15,6 @@ FROM alpine:3.13 ...@@ -15,5 +15,6 @@ FROM alpine:3.13
RUN apk add --no-cache ca-certificates jq curl RUN apk add --no-cache ca-certificates jq curl
COPY --from=builder /go/batch-submitter/batch-submitter /usr/local/bin/ COPY --from=builder /go/batch-submitter/batch-submitter /usr/local/bin/
WORKDIR /usr/local/bin
COPY ./ops/scripts/batch-submitter.sh . COPY ./ops/scripts/batch-submitter.sh .
ENTRYPOINT ["batch-submitter"] ENTRYPOINT ["batch-submitter"]
...@@ -2,7 +2,7 @@ FROM golang:1.15-alpine3.13 as builder ...@@ -2,7 +2,7 @@ FROM golang:1.15-alpine3.13 as builder
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
ADD ./go/gas-oracle /gas-oracle COPY ./go/gas-oracle /gas-oracle
RUN cd /gas-oracle && make gas-oracle RUN cd /gas-oracle && make gas-oracle
FROM alpine:3.13 FROM alpine:3.13
...@@ -10,5 +10,6 @@ FROM alpine:3.13 ...@@ -10,5 +10,6 @@ FROM alpine:3.13
RUN apk add --no-cache ca-certificates jq curl RUN apk add --no-cache ca-certificates jq curl
COPY --from=builder /gas-oracle/gas-oracle /usr/local/bin/ COPY --from=builder /gas-oracle/gas-oracle /usr/local/bin/
WORKDIR /usr/local/bin/
COPY ./ops/scripts/gas-oracle.sh . COPY ./ops/scripts/gas-oracle.sh .
ENTRYPOINT ["gas-oracle"] ENTRYPOINT ["gas-oracle"]
...@@ -15,6 +15,7 @@ FROM alpine:3.13 ...@@ -15,6 +15,7 @@ FROM alpine:3.13
RUN apk add --no-cache ca-certificates jq curl RUN apk add --no-cache ca-certificates jq curl
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
WORKDIR /usr/local/bin/
EXPOSE 8545 8546 8547 EXPOSE 8545 8546 8547
COPY ./ops/scripts/geth.sh . COPY ./ops/scripts/geth.sh .
ENTRYPOINT ["geth"] ENTRYPOINT ["geth"]
FROM golang:1.16 as builder FROM golang:1.16 as builder
ADD ./go/l2geth-exporter /app/ COPY ./go/l2geth-exporter /app/
WORKDIR /app/ WORKDIR /app/
RUN make build RUN make build
FROM alpine:latest FROM alpine:3.13
RUN apk --no-cache add ca-certificates RUN apk --no-cache add ca-certificates
WORKDIR /root/ WORKDIR /root/
COPY --from=builder /app/l2geth-exporter /usr/local/bin/ COPY --from=builder /app/l2geth-exporter /usr/local/bin/
......
FROM golang:1.16 as builder FROM golang:1.16 as builder
ADD ./go/op-exporter /app/ COPY ./go/op-exporter /app/
WORKDIR /app/ WORKDIR /app/
RUN make build RUN make build
FROM alpine:latest FROM alpine:3.13
RUN apk --no-cache add ca-certificates RUN apk --no-cache add ca-certificates
WORKDIR /root/ WORKDIR /root/
COPY --from=builder /app/op-exporter /usr/local/bin/ COPY --from=builder /app/op-exporter /usr/local/bin/
......
...@@ -6,7 +6,12 @@ ...@@ -6,7 +6,12 @@
# when used with typescript/hardhat: https://github.com/nomiclabs/hardhat/issues/1219 # when used with typescript/hardhat: https://github.com/nomiclabs/hardhat/issues/1219
FROM node:16.13-buster-slim as base FROM node:16.13-buster-slim as base
RUN apt-get update -y && apt-get install -y git curl jq python3 RUN apt-get update -y && apt-get install -y --no-install-recommends git \
curl \
jq \
python3 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# copy over the needed configs to run the dep installation # copy over the needed configs to run the dep installation
# note: this approach can be a bit unhandy to maintain, but it allows # note: this approach can be a bit unhandy to maintain, but it allows
...@@ -22,7 +27,7 @@ COPY packages/message-relayer/package.json ./packages/message-relayer/package.js ...@@ -22,7 +27,7 @@ COPY packages/message-relayer/package.json ./packages/message-relayer/package.js
COPY packages/replica-healthcheck/package.json ./packages/replica-healthcheck/package.json COPY packages/replica-healthcheck/package.json ./packages/replica-healthcheck/package.json
COPY integration-tests/package.json ./integration-tests/package.json COPY integration-tests/package.json ./integration-tests/package.json
RUN yarn install --frozen-lockfile RUN yarn install --frozen-lockfile && yarn cache clean
COPY ./packages ./packages COPY ./packages ./packages
COPY ./integration-tests ./integration-tests COPY ./integration-tests ./integration-tests
......
...@@ -8,7 +8,7 @@ COPY [ \ ...@@ -8,7 +8,7 @@ COPY [ \
# install deps # install deps
WORKDIR /hardhat WORKDIR /hardhat
RUN yarn install RUN yarn install && yarn cache clean
# bring in dockerenv so that hardhat launches with host = 0.0.0.0 instead of 127.0.0.1 # bring in dockerenv so that hardhat launches with host = 0.0.0.0 instead of 127.0.0.1
# so that it's accessible from other boxes as well # so that it's accessible from other boxes as well
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment