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
|
PATH=/usr/local/cargo/bin:$PATH:/home/vscode/.cargo/bin
|
||||||
|
|
||||||
RUN apt-get update && \
|
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/* && \
|
apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* && \
|
||||||
adduser ${USERNAME} && \
|
adduser ${USERNAME} && \
|
||||||
echo "$USERNAME ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers && \
|
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 \
|
--default-toolchain nightly --default-host x86_64-unknown-linux-gnu \
|
||||||
--component rustfmt --component rust-src --component clippy && \
|
--component rustfmt --component rust-src --component clippy && \
|
||||||
rm rustup-init && \
|
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
|
USER vscode
|
||||||
|
|
||||||
RUN cargo install cargo-make
|
RUN cargo install cargo-make convco
|
||||||
@ -28,7 +28,7 @@
|
|||||||
"--security-opt",
|
"--security-opt",
|
||||||
"seccomp=unconfined"
|
"seccomp=unconfined"
|
||||||
],
|
],
|
||||||
"postStartCommand": "git submodule update --init && docker pull rust:1-alpine",
|
"postStartCommand": "cargo make setup",
|
||||||
"remoteUser": "vscode",
|
"remoteUser": "vscode",
|
||||||
"features": {
|
"features": {
|
||||||
"ghcr.io/devcontainers/features/docker-in-docker": {}
|
"ghcr.io/devcontainers/features/docker-in-docker": {}
|
||||||
|
|||||||
@ -11,3 +11,22 @@ dependencies = ["build"]
|
|||||||
workspace = false
|
workspace = false
|
||||||
command = "docker-compose"
|
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
|
- ${PWD}:/sparse
|
||||||
working_dir: /sparse
|
working_dir: /sparse
|
||||||
entrypoint: "/usr/local/cargo/bin/cargo build"
|
entrypoint: "/usr/local/cargo/bin/cargo build"
|
||||||
|
tty: true
|
||||||
|
|
||||||
examples_bindshell_target:
|
examples_bindshell_target:
|
||||||
build:
|
build:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user