Dockerfile (956B)
1 # base image 2 FROM docker.io/fedora:latest 3 4 RUN dnf -y update 5 6 # install basic Python development and frequently used packages 7 RUN dnf -y install \ 8 python-devel \ 9 python-build \ 10 python-numpy \ 11 python-pandas \ 12 python-matplotlib \ 13 python-pytest \ 14 python-pytest-cov 15 16 # we could add other custom Python code if we needed to. For example the 17 # cs107_package from lecture 9 (we will not do it because we will build this 18 # package using this container!) 19 # 20 # RUN python3 -m pip install -i https://test.pypi.org/simple/ Fall2022-CS107 21 22 # you can COPY a local file into the container image (the file will be 23 # added to the image file system) 24 COPY local_file . 25 26 # you can use any shell commands with the RUN command 27 RUN echo "Hello CS107/AC207 Docker!" >hello.txt 28 29 # entry point is bash shell 30 CMD ["/bin/bash"] 31 32 # add non-root user (optional, for GitHub Actions user must be root) 33 # RUN useradd -m cs107 34 # WORKDIR /home/cs107 35 # USER cs107