devbox-devcontainer/.devcontainer/Dockerfile
2024-10-20 18:03:13 +02:00

44 lines
1.1 KiB
Docker

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/*
# Installing devbox
RUN curl -fsSL https://get.jetify.com/devbox | bash -s -- -f
RUN devbox version update
# 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
# Now use devbox as global package manager
RUN echo '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"]
WORKDIR /workspace
CMD ["sh"]