Skip to content

Commit

Permalink
dev: add Dev Container
Browse files Browse the repository at this point in the history
+ Update and move Dockerfile to .devcontainer;
  • Loading branch information
SingularityKChen committed Oct 19, 2023
1 parent 97ea97e commit 451344f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 49 deletions.
34 changes: 34 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM archlinux:latest AS root

ENV LANG=C.UTF-8

RUN pacman -Syu --noconfirm make parallel wget cmake ninja verilator git llvm clang python autoconf automake

RUN pacman -Syu --noconfirm vim which

# Install GraalVM Ref: https://github.com/chipsalliance/chisel/blob/86b2a7d3f7807ca0d1d8a725bd87ee4be1f61007/.devcontainer/Dockerfile#L32-L40
# This downloads all relevant GraalVM architectures at once, mostly because $TARGETARCH values don't map exactly to the release URLs. Since we're optimizing for developer experience here and not image size, this is OK
# GraalVM release links can be found here: https://github.com/graalvm/graalvm-ce-builds/releases
ENV JAVA_VERSION=java11
#ADD https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/graalvm-ce-$JAVA_VERSION-linux-aarch64-22.3.1.tar.gz /graalvm/tarballs/arm64.tar.gz
ADD https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/graalvm-ce-$JAVA_VERSION-linux-amd64-22.3.1.tar.gz /graalvm/tarballs/amd64.tar.gz
#RUN tar -xzf /graalvm/tarballs/$TARGETARCH.tar.gz -C /graalvm --strip-components=1
RUN tar -xzf /graalvm/tarballs/amd64.tar.gz -C /graalvm --strip-components=1
ENV JAVA_HOME=/graalvm
ENV PATH=$JAVA_HOME/bin/:$PATH

# Download and install mill
RUN curl -L https://github.com/com-lihaoyi/mill/releases/download/0.11.5/0.11.5 > mill && \
chmod +x mill && \
mv mill /usr/bin/mill

# ivy development dependencies
RUN cd /tmp && \
git clone https://github.com/SingularityKChen/chisel-chipware.git
RUN cd /tmp/chisel-chipware && \
mill -i -j 0 __.compile && \
mill -i -j 0 __.reformat && \
cd .. && \
rm -rf chisel-chipware

CMD ["/usr/bin/bash"]
7 changes: 7 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "ViTA Dev",
"build": {
// Path is relative to the devcontainer.json file.
"dockerfile": "Dockerfile"
}
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ doc:
utils/mill -j 0 show __.docJar

build_docker:
docker build -f docker/Dockerfile -t chisel-chipware:latest .
docker build -f .devcontainer/Dockerfile -t chisel-chipware:latest .

run_docker: build_docker
docker run -it --rm -v $(shell pwd):/workspace/$(shell basename $$(pwd)) --workdir /workspace/$(shell basename $$(pwd)) chisel-chipware:latest
Expand Down
48 changes: 0 additions & 48 deletions docker/Dockerfile

This file was deleted.

0 comments on commit 451344f

Please sign in to comment.