Created
June 5, 2024 18:18
-
-
Save DELAGREEN/b73a27b99043e4524c0415ed95e3ba1e to your computer and use it in GitHub Desktop.
Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:20.04 | |
| USER root | |
| WORKDIR /root | |
| SHELL [ "/bin/bash", "-c" ] | |
| ARG PYTHON_VERSION_TAG=3.10.5 | |
| ARG LINK_PYTHON_TO_PYTHON3=1 | |
| # Existing lsb_release causes issues with modern installations of Python3 | |
| # https://github.com/pypa/pip/issues/4924#issuecomment-435825490 | |
| # Set (temporarily) DEBIAN_FRONTEND to avoid interacting with tzdata | |
| RUN apt-get -qq -y update && \ | |
| DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \ | |
| gcc \ | |
| g++ \ | |
| zlibc \ | |
| zlib1g-dev \ | |
| libssl-dev \ | |
| libbz2-dev \ | |
| libsqlite3-dev \ | |
| libncurses5-dev \ | |
| libgdbm-dev \ | |
| libgdbm-compat-dev \ | |
| liblzma-dev \ | |
| libreadline-dev \ | |
| uuid-dev \ | |
| libffi-dev \ | |
| tk-dev \ | |
| wget \ | |
| curl \ | |
| git \ | |
| make \ | |
| sudo \ | |
| bash-completion \ | |
| tree \ | |
| vim \ | |
| software-properties-common && \ | |
| mv /usr/bin/lsb_release /usr/bin/lsb_release.bak && \ | |
| apt-get -y autoclean && \ | |
| apt-get -y autoremove && \ | |
| rm -rf /var/lib/apt/lists/* | |
| COPY install_python.sh install_python.sh | |
| RUN bash install_python.sh ${PYTHON_VERSION_TAG} ${LINK_PYTHON_TO_PYTHON3} && \ | |
| rm -r install_python.sh Python-${PYTHON_VERSION_TAG} | |
| # Enable tab completion by uncommenting it from /etc/bash.bashrc | |
| # The relevant lines are those below the phrase "enable bash completion in interactive shells" | |
| RUN export SED_RANGE="$(($(sed -n '\|enable bash completion in interactive shells|=' /etc/bash.bashrc)+1)),$(($(sed -n '\|enable bash completion in interactive shells|=' /etc/bash.bashrc)+7))" && \ | |
| sed -i -e "${SED_RANGE}"' s/^#//' /etc/bash.bashrc && \ | |
| unset SED_RANGE | |
| # Create user "docker" with sudo powers | |
| RUN useradd -m docker && \ | |
| usermod -aG sudo docker && \ | |
| echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \ | |
| cp /root/.bashrc /home/docker/ && \ | |
| mkdir /home/docker/data && \ | |
| chown -R --from=root docker /home/docker | |
| # Use C.UTF-8 locale to avoid issues with ASCII encoding | |
| ENV LC_ALL=C.UTF-8 | |
| ENV LANG=C.UTF-8 | |
| WORKDIR /home/docker/data | |
| ENV HOME /home/docker | |
| ENV USER docker | |
| USER docker | |
| ENV PATH /home/docker/.local/bin:$PATH | |
| # Avoid first use of sudo warning. c.f. https://askubuntu.com/a/22614/781671 | |
| RUN touch $HOME/.sudo_as_admin_successful | |
| # Install ODA DWG-DXF Converter | |
| COPY ODAFileConverter.AppImage /usr/bin/ | |
| RUN chmod a+x /usr/bin/ODAFileConverter.AppImage | |
| # Install dependencies | |
| #COPY requirements.txt requirements.txt | |
| #RUN pip3 install -r requirements.txt | |
| COPY /tools/test.tar.xz | |
| COPY /tools/ODAFileConverter_QT6_lnxX64_8.3dll_25.4.deb | |
| COPY /tool/main.py | |
| CMD [ "/bin/bash" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment