Skip to content

Commit

Permalink
Fix Dockerlint warnings & errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed May 19, 2021
1 parent ac06142 commit 96f1ad8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 29 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/coding-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
fi
- name: 🐳 hadolint
uses: brpaz/hadolint-action@v1.4.0
uses: brpaz/hadolint-action@v1.5.0
with:
dockerfile: "server/Dockerfile"
failure-threshold: warning
53 changes: 25 additions & 28 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
libtool=2.4.* \
make=4.2.* \
pkg-config=0.29-* \
zlib1g-dev=1:1.2.*
zlib1g-dev=1:1.2.* \
&& rm -rf /var/lib/apt/lists/*

RUN cabal update

# Build IOHK's libsodium fork, needed by cardano-node
WORKDIR /app/src
RUN git clone https://github.com/input-output-hk/libsodium.git &&\
cd libsodium &&\
WORKDIR /app/src/libsodium
RUN git clone https://github.com/input-output-hk/libsodium.git /app/src/libsodium &&\
git fetch --all --tags &&\
git checkout ${IOHK_LIBSODIUM_GIT_REV}
WORKDIR /app/src/libsodium
Expand All @@ -42,9 +42,8 @@ ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"

# Build cardano-node.
WORKDIR /app/src
RUN git clone https://github.com/input-output-hk/cardano-node.git &&\
cd cardano-node &&\
WORKDIR /app/src/cardano-node
RUN git clone https://github.com/input-output-hk/cardano-node.git /app/src/cardano-node &&\
git fetch --all --tags &&\
git checkout ${CARDANO_NODE_VERSION}
WORKDIR /app/src/cardano-node
Expand All @@ -54,9 +53,8 @@ RUN cabal install cardano-node \
--installdir=/app/bin

# Pre-build latest release of ogmios, to speed up the actual image build later.
WORKDIR /app/src
RUN git clone https://github.com/KtorZ/cardano-ogmios.git &&\
cd cardano-ogmios &&\
WORKDIR /app/src/cardano-ogmios
RUN git clone https://github.com/KtorZ/cardano-ogmios.git /app/src/cardano-ogmios &&\
git fetch --all --tags &&\
git checkout ${CARDANO_OGMIOS_SNAPSHOT}
WORKDIR /app/src/cardano-ogmios/server
Expand Down Expand Up @@ -107,40 +105,39 @@ FROM debian:buster-slim as cardano-node-ogmios

ARG CARDANO_CONFIG_URL=https://hydra.iohk.io/build/5821110/download/1

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

LABEL name=cardano-node-ogmios
LABEL description="A JSON-WSP WebSocket client for cardano-node w/ a cardano-node"

# Ogmios, cardano-node, ekg, prometheus
EXPOSE 1337/tcp 3000/tcp 12788/tcp 12798/tcp

RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get install --no-install-recommends -y \
wget=1.20.1-* \
netbase=5.6
RUN apt-get -y purge && apt-get -y clean && apt-get -y autoremove && rm -rf /var/lib/apt/lists/*
netbase=5.6 \
ca-certificates=20200601* \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get -y purge && apt-get -y clean && apt-get -y autoremove

COPY --from=setup /usr/local/lib/libsodium.so.23 /usr/lib/x86_64-linux-gnu/libsodium.so.23
COPY --from=setup /app/bin/cardano-node /bin/cardano-node
COPY --from=build /app/bin/ogmios /bin/ogmios

WORKDIR /config

RUN wget ${CARDANO_CONFIG_URL}/mainnet-config.json
RUN wget ${CARDANO_CONFIG_URL}/mainnet-byron-genesis.json
RUN wget ${CARDANO_CONFIG_URL}/mainnet-shelley-genesis.json
RUN wget ${CARDANO_CONFIG_URL}/mainnet-topology.json

RUN wget ${CARDANO_CONFIG_URL}/testnet-config.json
RUN wget ${CARDANO_CONFIG_URL}/testnet-byron-genesis.json
RUN wget ${CARDANO_CONFIG_URL}/testnet-shelley-genesis.json
RUN wget ${CARDANO_CONFIG_URL}/testnet-topology.json
RUN wget -q ${CARDANO_CONFIG_URL}/mainnet-config.json
RUN wget -q ${CARDANO_CONFIG_URL}/mainnet-byron-genesis.json
RUN wget -q ${CARDANO_CONFIG_URL}/mainnet-shelley-genesis.json
RUN wget -q ${CARDANO_CONFIG_URL}/mainnet-topology.json

RUN wget ${CARDANO_CONFIG_URL}/staging-config.json
RUN wget ${CARDANO_CONFIG_URL}/staging-byron-genesis.json
RUN wget ${CARDANO_CONFIG_URL}/staging-shelley-genesis.json
RUN wget ${CARDANO_CONFIG_URL}/staging-topology.json
RUN wget -q ${CARDANO_CONFIG_URL}/testnet-config.json
RUN wget -q ${CARDANO_CONFIG_URL}/testnet-byron-genesis.json
RUN wget -q ${CARDANO_CONFIG_URL}/testnet-shelley-genesis.json
RUN wget -q ${CARDANO_CONFIG_URL}/testnet-topology.json

RUN find . -name "*config*.json" -print0 | xargs -0 sed -i 's/127.0.0.1/0.0.0.0/g' > /dev/null 2>&1

WORKDIR /root
COPY scripts/entrypoint.sh entrypoint.sh
CMD ./entrypoint.sh
COPY scripts/cardano-node-ogmios.sh cardano-node-ogmios.sh
CMD ["bash", "cardano-node-ogmios.sh" ]
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

set -m

if [ -z "$NETWORK" ]; then
Expand Down

0 comments on commit 96f1ad8

Please sign in to comment.