Skip to content

Commit

Permalink
Fix build type in Docker (#4249)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jun 22, 2023
1 parent d33803e commit 54593ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- ${{ startsWith(github.ref, 'refs/tags/') }}
env:
BACKEND: ${{ matrix.BACKEND }}
RELEASE: ${{ matrix.RELEASE }}
BUILD_TYPE: ${{ matrix.RELEASE && 'RelWithDebInfo' || 'Debug' }}
TEST_USE_ROCKSDB: ${{ matrix.BACKEND == 'rocksdb' && '1' || '0' }}
DEADLINE_SCALE_FACTOR: ${{ matrix.BACKEND == 'rocksdb' && '2' || '1' }}
runs-on: macos-12
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
env:
COMPILER: ${{ matrix.COMPILER }}
BACKEND: ${{ matrix.BACKEND }}
RELEASE: ${{ matrix.RELEASE }}
BUILD_TYPE: ${{ matrix.RELEASE && 'RelWithDebInfo' || 'Debug' }}
TEST_USE_ROCKSDB: ${{ matrix.BACKEND == 'rocksdb' && '1' || '0' }}
DEADLINE_SCALE_FACTOR: ${{ matrix.BACKEND == 'rocksdb' && '2' || '1' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Expand Down Expand Up @@ -144,8 +144,9 @@ jobs:
runs-on: windows-latest
env:
BACKEND: ${{ matrix.BACKEND }}
RELEASE: ${{ matrix.RELEASE }}
BUILD_TYPE: ${{ matrix.RELEASE && 'RelWithDebInfo' || 'Debug' }}
TEST_USE_ROCKSDB: ${{ matrix.BACKEND == 'rocksdb' && '1' || '0' }}
DEADLINE_SCALE_FACTOR: ${{ matrix.BACKEND == 'rocksdb' && '2' || '1' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Checkout
Expand Down
6 changes: 0 additions & 6 deletions ci/build-tests.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#!/bin/bash
set -euox pipefail

BUILD_TYPE="Debug"
if [[ "${RELEASE:-false}" == "true" ]]; then
BUILD_TYPE="RelWithDebInfo"
fi

BUILD_TYPE=$BUILD_TYPE \
NANO_TEST=ON \
NANO_NETWORK=dev \
NANO_GUI=ON \
Expand Down
6 changes: 4 additions & 2 deletions docker/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM ubuntu:22.04 as builder

ARG COMPILER=gcc
ARG BUILD_TYPE=RelWithDebInfo
ARG SANITIZER
ARG NANO_NETWORK=live
ARG CI_TAG=DEV_BUILD
ARG CI_BUILD=OFF
Expand All @@ -20,7 +22,7 @@ RUN echo ${NANO_NETWORK} >/etc/nano-network
FROM ubuntu:22.04

RUN groupadd --gid 1000 nanocurrency && \
useradd --uid 1000 --gid nanocurrency --shell /bin/bash --create-home nanocurrency
useradd --uid 1000 --gid nanocurrency --shell /bin/bash --create-home nanocurrency

COPY --from=builder /tmp/src/build/nano_node /usr/bin
COPY --from=builder /tmp/src/build/nano_rpc /usr/bin
Expand All @@ -41,4 +43,4 @@ ENTRYPOINT ["/usr/bin/entry.sh"]
CMD ["nano_node", "daemon", "-l"]

ARG REPOSITORY=nanocurrency/nano-node
LABEL org.opencontainers.image.source https://github.com/$REPOSITORY
LABEL org.opencontainers.image.source https://github.com/$REPOSITORY

0 comments on commit 54593ee

Please sign in to comment.