diff --git a/Dockerfile b/Dockerfile index a687cd8..5429719 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN sed -i 's/sudo/#sudo/g' ./prepare_environment.sh \ && ./prepare_environment.sh \ && rm ./prepare_environment.sh -# Install LiteX. +# Install LiteX. TODO: put in litex directory. COPY --chown=user:user litex/litex_setup.py /home/user WORKDIR /home/user RUN chmod +x litex_setup.py \ @@ -33,3 +33,5 @@ conda run -n xc7 ./litex_setup.py --init --install --user --tag=2023.04' WORKDIR /home/user COPY --chown=user:user buildroot.tar.gz /home/user RUN tar -xvf buildroot.tar.gz && rm buildroot.tar.gz +USER root:root +RUN apt-get -y install build-essential gcc g++ sed make binutils diffutils bash patch gzip bzip2 perl tar cpio unzip rsync bc findutils wget diff --git a/Makefile b/Makefile index 2a87886..6df30e4 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,32 @@ -.PHONY: image f4pga buildroot litex clone help +.PHONY: image f4pga buildroot litex clone help container attach ADDED_FILES=f4pga/scripts/prepare_environment.sh litex/litex_setup.py buildroot.tar.gz help: - @echo 'make image: build docker image' - @echo 'make open: open docker image' + @echo 'compile commands (run in order)' @echo 'make clone: clone repositories' + @echo 'make image: build docker image' + @echo 'make container: create docker container' + @echo + @echo 'run commands' + @echo 'make attach: open docker container' + @echo + @echo 'clean commands' + @echo 'make clean-container: delete docker container' image: ${ADDED_FILES} docker build -t "upsilon-buildenv" . +container: + docker run --name upsilon-container --volume .:/home/user/outside -it upsilon-buildenv /bin/bash -l + +clean-container: + -docker stop upsilon-container + docker rm upsilon-container + +attach: + -docker start upsilon-container + docker attach upsilon-container + ## Download external projects clone: f4pga buildroot litex