Skip to content

Commit 9431369

Browse files
authored
Merge pull request #45 from abel-bernabeu/dev/abel/docker-helpers-2
More improvements for development within the docker container
2 parents 00d3c8f + 24b3c0e commit 9431369

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

.dockerignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ htmlcov/
6060
.backup/
6161

6262
# Docker files (don't copy into container)
63-
Dockerfile
64-
docker-compose.yaml
63+
docker/build.sh
64+
docker/docker-compose.yaml
65+
docker/Dockerfile
66+
docker/entrypoint.sh
67+
docker/run.sh
6568
.dockerignore
6669

6770
# CI/CD

docker/Dockerfile

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ ARG VERBOSE
3333
# Copy the RISC-V GNU Toolchain from the previous stage
3434
COPY --from=toolchain_builder ${ET_INSTALL_DIR} ${ET_INSTALL_DIR}
3535

36+
# Update package list from sources
37+
RUN apt-get update
38+
3639
# Install ET Platform build dependencies
37-
RUN apt-get update && apt-get install -y \
40+
RUN apt-get install -y \
3841
cmake \
3942
dos2unix \
4043
gcc \
@@ -59,8 +62,7 @@ RUN apt-get update && apt-get install -y \
5962
python3-breathe \
6063
python3-jsonschema \
6164
libfmt-dev \
62-
xxd \
63-
&& rm -rf /var/lib/apt/lists/*
65+
xxd
6466

6567
# Set working directory for the ET Platform source
6668
WORKDIR /workspace
@@ -85,6 +87,23 @@ RUN cmake \
8587
ARG BUILD_JOBS=4
8688
RUN make ${VERBOSE:+VERBOSE=1} -j${BUILD_JOBS}
8789

90+
# Optional tools for developers working inside of the docker.
91+
#
92+
# It is fine to add new fancy tools here as long as we keep these packages
93+
# apart from those listed above, so packages that strictly are build
94+
# dependencies are not mixed with optionals.
95+
#
96+
# Besides, installing these packages has to be one of the last steps in the
97+
# docker image build, so the list of optionals can be updated frequently
98+
# without retriggering the bulk of the build for every user.
99+
RUN apt-get install -y \
100+
sudo \
101+
vim \
102+
ccache
103+
104+
# Clean up package lists
105+
RUN rm -rf /var/lib/apt/lists/*
106+
88107
# Set the default working directory
89108
WORKDIR /workspace
90109

docker/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
set -e
44
set -x
55

6-
docker build -t et-platform -f docker/Dockerfile .
6+
docker build --build-arg BUILD_JOBS=$(nproc) -t et-platform -f docker/Dockerfile .

0 commit comments

Comments
 (0)