Build both CI and main images in one dockerfile. Updated README.md
This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
General
|
|
||||||
-------
|
|
||||||
This DockerFile contains the necessary steps to build a Docker container that can run
|
|
||||||
projects with riscv-tools, chisel3, firrtl, and verilator. It installs the necessary
|
|
||||||
apt-get packages and sets the environment variables needed in CircleCI.
|
|
||||||
|
|
||||||
Build and Deploy the Container
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
sudo docker build . # to test build before building it with a tag
|
|
||||||
sudo docker build -t <PATH_NAME>:tag . # to build with tag (ex. 0.0.3)
|
|
||||||
sudo docker login # login into the account to push to
|
|
||||||
sudo docker push <PATH_NAME>:tag # to push to repo with tag
|
|
||||||
|
|
||||||
Path Names
|
|
||||||
----------
|
|
||||||
Older docker images (when this Dockerfile was in `riscv-boom/riscv-boom`) can be found in the <PATH_NAME> `riscvboom/riscvboom-images`.
|
|
||||||
Current up-to-date images are located in <PATH_NAME> `ucbbar/chipyard-image`
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
### Note: This DockerFile is adapted from https://github.com/ucb-bar/chipyard/blob/master/.circleci/images/Dockerfile which was adapted from: https://github.com/CircleCI-Public/example-images/openjdk
|
### Note: This DockerFile is adapted from: https://github.com/CircleCI-Public/example-images/openjdk
|
||||||
# This is a chipyard setup for CI, no toolchains are initialized
|
# This is a chipyard setup for CI, no toolchains are initialized
|
||||||
|
|
||||||
FROM ubuntu:18.04
|
FROM ubuntu:18.04
|
||||||
@@ -32,7 +32,7 @@ ENV RISCV="/home/riscvuser/riscv-tools-install"
|
|||||||
ENV LD_LIBRARY_PATH="$RISCV/lib"
|
ENV LD_LIBRARY_PATH="$RISCV/lib"
|
||||||
ENV PATH="$RISCV/bin:$PATH"
|
ENV PATH="$RISCV/bin:$PATH"
|
||||||
|
|
||||||
# Install Chipyard
|
# Install Chipyard and run ubuntu-req.sh to install necessary dependencies
|
||||||
RUN git clone https://github.com/ucb-bar/chipyard.git && \
|
RUN git clone https://github.com/ucb-bar/chipyard.git && \
|
||||||
cd chipyard && \
|
cd chipyard && \
|
||||||
git checkout $CHIPYARD_HASH && \
|
git checkout $CHIPYARD_HASH && \
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
### Note: This DockerFile is adapted from https://github.com/ucb-bar/chipyard/blob/master/.circleci/images/Dockerfile which was adapted from: https://github.com/CircleCI-Public/example-images/openjdk
|
### Note: This DockerFile is adapted from https://github.com/ucb-bar/chipyard/blob/master/.circleci/images/Dockerfile which was adapted from: https://github.com/CircleCI-Public/example-images/openjdk
|
||||||
# This is a full chipyard setup
|
# This is a full chipyard setup
|
||||||
|
|
||||||
FROM ubuntu:18.04
|
# BUILD BASE FOR CI
|
||||||
|
|
||||||
|
FROM ubuntu:18.04 as base
|
||||||
ARG CHIPYARD_HASH
|
ARG CHIPYARD_HASH
|
||||||
|
|
||||||
MAINTAINER https://groups.google.com/forum/#!forum/chipyard
|
MAINTAINER https://groups.google.com/forum/#!forum/chipyard
|
||||||
@@ -27,13 +29,24 @@ RUN groupadd --gid 3434 riscvuser \
|
|||||||
WORKDIR /home/riscvuser
|
WORKDIR /home/riscvuser
|
||||||
USER riscvuser
|
USER riscvuser
|
||||||
|
|
||||||
# Install Chipyard
|
# Update PATH for RISCV toolchain (note: hardcoded for CircleCI)
|
||||||
|
ENV RISCV="/home/riscvuser/riscv-tools-install"
|
||||||
|
ENV LD_LIBRARY_PATH="$RISCV/lib"
|
||||||
|
ENV PATH="$RISCV/bin:$PATH"
|
||||||
|
|
||||||
|
# Install Chipyard and run ubuntu-req.sh to install necessary dependencies
|
||||||
RUN git clone https://github.com/ucb-bar/chipyard.git && \
|
RUN git clone https://github.com/ucb-bar/chipyard.git && \
|
||||||
cd chipyard && \
|
cd chipyard && \
|
||||||
git checkout $CHIPYARD_HASH && \
|
git checkout $CHIPYARD_HASH && \
|
||||||
./scripts/ubuntu-req.sh 1>/dev/null
|
./scripts/ubuntu-req.sh 1>/dev/null
|
||||||
|
|
||||||
# Run ubuntu-req.sh to install necessary dependencies
|
|
||||||
|
# BUILD IMAGE WITH TOOLCHAINS
|
||||||
|
|
||||||
|
# Use above build as base
|
||||||
|
FROM base as base-with-tools
|
||||||
|
|
||||||
|
# Init submodules
|
||||||
RUN cd chipyard && \
|
RUN cd chipyard && \
|
||||||
export MAKEFLAGS=-"j $(nproc)" && \
|
export MAKEFLAGS=-"j $(nproc)" && \
|
||||||
./scripts/init-submodules-no-riscv-tools.sh 1>/dev/null
|
./scripts/init-submodules-no-riscv-tools.sh 1>/dev/null
|
||||||
@@ -44,10 +57,11 @@ RUN cd chipyard && \
|
|||||||
./scripts/build-toolchains.sh riscv-tools 1>/dev/null
|
./scripts/build-toolchains.sh riscv-tools 1>/dev/null
|
||||||
|
|
||||||
# Install esp-tools
|
# Install esp-tools
|
||||||
RUN cd chipyard && \
|
RUN cd chipyard && \
|
||||||
export MAKEFLAGS=-"j $(nproc)" && \
|
export MAKEFLAGS=-"j $(nproc)" && \
|
||||||
./scripts/build-toolchains.sh esp-tools 1>/dev/null
|
./scripts/build-toolchains.sh esp-tools 1>/dev/null
|
||||||
|
|
||||||
|
# Run script to set environment variables on entry
|
||||||
ENTRYPOINT ["chipyard/scripts/entrypoint.sh"]
|
ENTRYPOINT ["chipyard/scripts/entrypoint.sh"]
|
||||||
|
|
||||||
# END IMAGE CUSTOMIZATIONS
|
# END IMAGE CUSTOMIZATIONS
|
||||||
20
dockerfiles/README.md
Normal file
20
dockerfiles/README.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
General
|
||||||
|
-------
|
||||||
|
This DockerFile contains the necessary steps to build a Docker container that can run
|
||||||
|
projects with riscv-tools, chisel3, firrtl, and verilator. When run up to the base stage, it installs the necessary
|
||||||
|
apt-get packages and sets the environment variables needed in CircleCI. When run up to the base-with-tools stage, it initializes and installs the necessary toolchains for running simulations and testing projects.
|
||||||
|
|
||||||
|
Build and Deploy the Container
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
sudo docker build --target base -f Dockerfile . # to build the image for the CI
|
||||||
|
sudo docker build --target base-with-tools -f Dockerfile . # to build the full image
|
||||||
|
sudo docker tag <IMAGE_ID> <PATH_NAME>:tag . # to tag the image after the build (ex. 0.0.3)
|
||||||
|
sudo docker login # login into the account to push to
|
||||||
|
sudo docker push <PATH_NAME>:tag # to push to repo with tag
|
||||||
|
sudo docker run -it <IMAGE_ID> bash # to run an interactive version of the container
|
||||||
|
|
||||||
|
Path Names
|
||||||
|
----------
|
||||||
|
Older docker images (when this Dockerfile was in `riscv-boom/riscv-boom`) can be found in the <PATH_NAME> `riscvboom/riscvboom-images`.
|
||||||
|
Current up-to-date images are located in <PATH_NAME> `ucbbar/chipyard-image`
|
||||||
Reference in New Issue
Block a user