Skip to content

Commit

Permalink
fix: docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
vfusco committed Mar 25, 2024
1 parent cacb3c1 commit 615313a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ ENV LINUX_HEADERS_FILEPATH=/tmp/linux-libc-dev-riscv64-cross-${LINUX_VERSION}-${
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
dpkg-dev \
g++-12 \
gcc-12 \
make \
ca-certificates \
git \
wget \
pkg-config \
crossbuild-essential-riscv64 \
dpkg-cross \
gcc-12-riscv64-linux-gnu \
g++-12-riscv64-linux-gnu \
&& \
Expand Down Expand Up @@ -67,15 +70,12 @@ COPY --chown=developer:developer sys-utils/ ${BUILD_BASE}/tools/sys-utils/
# ------------------------------------------------------------------------------
FROM builder as c-builder
ARG CMT_BASE=${BUILD_BASE}/tools/sys-utils/libcmt
ARG CMT_TAR_GZ=libcmt-v0.14.1-dev.tar.gz
ARG BUILD_BASE=/opt/cartesi

USER developer
RUN make -C ${CMT_BASE} -j$(nproc) ioctl.build mock.build
RUN make -C ${CMT_BASE} -j$(nproc) libcmt host
USER root
RUN make -C ${CMT_BASE} -j$(nproc) ioctl.install TARGET_PREFIX=${CMT_BASE}/install && \
tar czf ${BUILD_BASE}/${CMT_TAR_GZ} -C ${CMT_BASE}/install .
RUN make -C ${BUILD_BASE}/tools/sys-utils/libcmt/ -j$(nproc) ioctl.install mock.install \
RUN make -C ${BUILD_BASE}/tools/sys-utils/libcmt/ -j$(nproc) install install-mock \
PREFIX=/usr/x86_64-linux-gnu TARGET_PREFIX=/usr/riscv64-linux-gnu
USER developer
RUN make -C ${BUILD_BASE}/tools/sys-utils/ -j$(nproc) all
Expand Down Expand Up @@ -160,4 +160,3 @@ COPY --from=c-builder ${BUILD_BASE}/tools/sys-utils/misc/* ${STAGING_BIN}
#COPY --from=echo-dapp-builder ${BUILD_BASE}/tools/rollup-http/echo-dapp/target/riscv64gc-unknown-linux-gnu/release/echo-dapp ${STAGING_BIN}

RUN dpkg-deb -Zxz --root-owner-group --build ${STAGING_BASE} ${BUILD_BASE}/${TOOLS_DEB}
COPY --from=c-builder ${BUILD_BASE}/${CMT_TAR_GZ} ${BUILD_BASE}/${CMT_TAR_GZ}
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ build: control
copy:
@ID=`docker create $(TOOLS_IMAGE)` && \
docker cp $$ID:/opt/cartesi/$(TOOLS_DEB) . && \
docker cp $$ID:/opt/cartesi/$(CMT_TAR_GZ) . && \
docker rm $$ID

$(TOOLS_DEB) deb: build
Expand Down
5 changes: 3 additions & 2 deletions fs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ ENV BUILD_BASE=/tmp/build-extra
# Install dependencies
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
wget \
crossbuild-essential-riscv64 \
patch \
libdigest-sha-perl \
libc6-dev-riscv64-cross \
gcc-12-riscv64-linux-gnu \
&& \
adduser developer -u 499 --gecos ",,," --disabled-password && \
Expand Down
2 changes: 1 addition & 1 deletion sys-utils/libcmt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TARGET_CFLAGS := -Wvla -O2 -g -Wall -pedantic -Wextra -Isrc
CFLAGS := -Wvla -O2 -g -Wall -pedantic -Wextra -Isrc

all: libcmt host
host: mock tools test
host: mock tools
#-------------------------------------------------------------------------------
examples_SRC := \
doc/examples/abi_encode_000.c \
Expand Down

0 comments on commit 615313a

Please sign in to comment.