42 lines
1.7 KiB
Docker
42 lines
1.7 KiB
Docker
# Copyright (C) 2023 Andrew Rioux
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU Affero General Public License as
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
# License, or (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU Affero General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
FROM ubuntu:22.04
|
|
|
|
ARG USERNAME=vscode
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
RUSTUP_HOME=/usr/local/rustup \
|
|
CARGO_HOME=/usr/local/cargo \
|
|
PATH=/usr/local/cargo/bin:$PATH:/home/vscode/.cargo/bin
|
|
|
|
RUN apt-get update && \
|
|
apt install -y git libtool valgrind docker-compose lldb sudo zsh wget && \
|
|
apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* && \
|
|
adduser ${USERNAME} && \
|
|
echo "$USERNAME ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers && \
|
|
chsh -s /usr/bin/zsh ${USERNAME} && \
|
|
wget https://static.rust-lang.org/rustup/archive/1.25.2/x86_64-unknown-linux-gnu/rustup-init && \
|
|
echo "bb31eaf643926b2ee9f4d8d6fc0e2835e03c0a60f34d324048aa194f0b29a71c *rustup-init" | sha256sum -c - && \
|
|
chmod +x rustup-init && \
|
|
./rustup-init -y --no-modify-path --profile minimal \
|
|
--default-toolchain nightly --default-host x86_64-unknown-linux-gnu \
|
|
--component rustfmt --component rust-src --component clippy && \
|
|
rm rustup-init && \
|
|
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
|
|
|
|
USER vscode
|
|
|
|
RUN cargo install cargo-make |