Skip to content

Commit

Permalink
chore: make image smaller, start dd agent at entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed Mar 3, 2022
1 parent ca63faa commit c971bee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions devnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
context: ./..
dockerfile: devnet/alice.Dockerfile
args:
DD_API_KEY: ${DD_API_KEY}
DD_API_KEY: c34650b22bcdf17fc1511e5a69db7129
ports:
- 7001
- 8545
Expand All @@ -20,7 +20,7 @@ services:
context: ./..
dockerfile: devnet/bob.Dockerfile
args:
DD_API_KEY: ${DD_API_KEY}
DD_API_KEY: c34650b22bcdf17fc1511e5a69db7129
key: bob
ports:
- 7001
Expand All @@ -38,7 +38,7 @@ services:
context: ./..
dockerfile: devnet/bob.Dockerfile
args:
DD_API_KEY: ${DD_API_KEY}
DD_API_KEY: c34650b22bcdf17fc1511e5a69db7129
key: charlie
ports:
- 7001
Expand Down
6 changes: 2 additions & 4 deletions devnet/substrate_alice.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ENV DD_API_KEY=${DD_API_KEY}
ENV CHAIN=${CHAIN}

USER root
RUN apt update && apt install -y curl
RUN apt update && apt install -y curl && rm -r /var/cache/* /var/lib/apt/lists/*

WORKDIR /cross-client

Expand All @@ -31,8 +31,6 @@ RUN curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script.sh --output
RUN DD_AGENT_MAJOR_VERSION=7 DD_INSTALL_ONLY=true DD_SITE="datadoghq.com" ./install_script.sh
COPY --from=openmetrics /devnet/conf.yaml /etc/datadog-agent/conf.d/openmetrics.d/

RUN service datadog-agent start

USER polkadot

COPY ./devnet/chain ./chain/
Expand All @@ -41,7 +39,7 @@ COPY ./devnet/chain ./chain/
# while gossamer nodes uses a 64 bytes long sr25519 key (32 bytes long to secret key + 32 bytes long to public key).
# Then to keep both substrate and gossamer alice nodes with the same libp2p node keys we just need to use
# the first 32 bytes from `alice.node.key` which means the 32 bytes long sr25519 secret key used here.
ENTRYPOINT /usr/bin/polkadot \
ENTRYPOINT service datadog-agent start && /usr/bin/polkadot \
--chain ./chain/$CHAIN/genesis-raw.json \
--alice \
--port 7001 \
Expand Down
6 changes: 2 additions & 4 deletions devnet/substrate_bob.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV CHAIN=${CHAIN}
ENV key=${key}

USER root
RUN apt update && apt install -y curl
RUN apt update && apt install -y curl && rm -r /var/cache/* /var/lib/apt/lists/*

WORKDIR /cross-client

Expand All @@ -34,13 +34,11 @@ RUN curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script.sh --output
RUN DD_AGENT_MAJOR_VERSION=7 DD_INSTALL_ONLY=true DD_SITE="datadoghq.com" ./install_script.sh
COPY --from=openmetrics /devnet/conf.yaml /etc/datadog-agent/conf.d/openmetrics.d/

RUN service datadog-agent start

USER polkadot

COPY ./devnet/chain ./chain/

ENTRYPOINT /usr/bin/polkadot \
ENTRYPOINT service datadog-agent start && /usr/bin/polkadot \
--bootnodes /dns/alice/tcp/7001/p2p/12D3KooWMER5iow67nScpWeVqEiRRx59PJ3xMMAYPTACYPRQbbWU \
--chain chain/$CHAIN/genesis-raw.json \
--port 7001 \
Expand Down

0 comments on commit c971bee

Please sign in to comment.