FROM ubuntu:20.04 # Define environment variable # ENV DEBUG ON ENV WORKDIR=/workspace ENV DEVBOX_USE_VERSION=0.13.5 ENV DEFAULT_TZ=Europe/Berlin # Install additional OS packages RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive TZ=${DEFAULT_TZ} apt-get -y install --no-install-recommends \ bash-completion \ binutils \ ca-certificates \ curl \ git \ xz-utils \ sudo \ # Clean up && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* # Install Nix package manager RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux --init none --no-confirm RUN echo "\n# Use devbox as global package manager\n" \ 'eval "$(devbox global shellenv --preserve-path-stack -r)" && hash -r' \ >> ~/.bashrc # Backup of the nix-store RUN cp -a /nix/store /nix-store-backup # Add start script COPY scripts/start.sh /usr/local/bin/start.sh RUN chmod +x /usr/local/bin/start.sh # Set start script as entrypoint ENTRYPOINT ["/usr/local/bin/start.sh"] # Installing devbox RUN curl -fsSL https://get.jetify.com/devbox | bash -s -- -f RUN devbox version update # Copy asciinema config to home dir COPY asciinema-config /root/.config/asciinema/config RUN echo "\n# Update root's bash prompt for asciinema expect commands\n" \ 'PS1="\u@\h:\w\$ "' \ >> ~/.bashrc WORKDIR /workspace # use sh ant not bash, because bash will initialize devbox runtime CMD ["sh"]