build: adding to Cargo make config
Adding default tasks and setup task to run when container is made
This commit is contained in:
parent
c984b9eb56
commit
3257dfced0
@ -1,2 +0,0 @@
|
||||
#[build]
|
||||
#target = "x86_64-unknown-linux-musl"
|
||||
@ -23,7 +23,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
|
||||
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 install -y cmake 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 && \
|
||||
@ -35,8 +35,9 @@ RUN apt-get update && \
|
||||
--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
|
||||
chmod -R a+w $RUSTUP_HOME $CARGO_HOME && \
|
||||
echo "alias make='cargo make'" >> /etc/profile
|
||||
|
||||
USER vscode
|
||||
|
||||
RUN cargo install cargo-make
|
||||
RUN cargo install cargo-make convco
|
||||
@ -28,7 +28,7 @@
|
||||
"--security-opt",
|
||||
"seccomp=unconfined"
|
||||
],
|
||||
"postStartCommand": "git submodule update --init && docker pull rust:1-alpine",
|
||||
"postStartCommand": "cargo make setup",
|
||||
"remoteUser": "vscode",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/docker-in-docker": {}
|
||||
|
||||
@ -10,4 +10,23 @@ dependencies = ["build"]
|
||||
[tasks.build]
|
||||
workspace = false
|
||||
command = "docker-compose"
|
||||
args = [ "run", "build", "${@}" ]
|
||||
args = ["run", "build", "${@}"]
|
||||
|
||||
[tasks.fmt]
|
||||
command = "cargo"
|
||||
args = ["fmt"]
|
||||
|
||||
#----------------------------------
|
||||
#
|
||||
# Project setup tasks
|
||||
#
|
||||
#----------------------------------
|
||||
|
||||
[tasks.setup]
|
||||
dependencies = ["pull-rust-image", "update-submodules"]
|
||||
|
||||
[tasks.pull-rust-image]
|
||||
shell = "docker pull rust:1-alpine"
|
||||
|
||||
[tasks.update-submodules]
|
||||
shell = "git submodule update --init"
|
||||
@ -9,6 +9,7 @@ services:
|
||||
- ${PWD}:/sparse
|
||||
working_dir: /sparse
|
||||
entrypoint: "/usr/local/cargo/bin/cargo build"
|
||||
tty: true
|
||||
|
||||
examples_bindshell_target:
|
||||
build:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user