proot-me / proot-rs

Rust implementation of PRoot, a ptrace-based sandbox
GNU General Public License v3.0
129 stars 21 forks source link

Create Dockerfile #20

Closed oxr463 closed 3 years ago

oxr463 commented 3 years ago

Closes: https://github.com/proot-me/proot-rs/issues/18

imlk0 commented 3 years ago

Is this Dockerfile used to test proot-rs? And is it related to https://github.com/proot-me/proot-rs/issues/6#issuecomment-846402777 ?

oxr463 commented 3 years ago

Is this Dockerfile used to test proot-rs? And is it related to #6 (comment) ?

Yes. We can build in the first stage, and then test in the second.

imlk0 commented 3 years ago

Sorry, there may be a problem with my expression. For testing, I think we can download the busybox rootfs tarball and unzip it into a directory. This way we can use it as a new rootfs for testing proot-rs. Maybe we just need a bash script to do this

Like this.

curl -o $rootfs_tarball -L -C - "https://github.com/docker-library/busybox/raw/dist-${arch}/stable/glibc/busybox.tar.xz" 
tar -C $rootfs -xf $rootfs_tarball
proot-rs --rootfs $rootfs /bin/sh # or we can run `cargo test`
oxr463 commented 3 years ago

Sorry, there may be a problem with my expression. For testing, I think we can download the busybox rootfs tarball and unzip it into a directory. This way we can use it as a new rootfs for testing proot-rs. Maybe we just need a bash script to do this

Like this.

curl -o $rootfs_tarball -L -C - "https://github.com/docker-library/busybox/raw/dist-${arch}/stable/glibc/busybox.tar.xz" 
tar -C $rootfs -xf $rootfs_tarball
proot-rs --rootfs $rootfs /bin/sh # or we can run `cargo test`

That makes sense. Do we need something like this to run the script before running the tests? https://github.com/sagiegurari/cargo-make

imlk0 commented 3 years ago

Sorry, there may be a problem with my expression. For testing, I think we can download the busybox rootfs tarball and unzip it into a directory. This way we can use it as a new rootfs for testing proot-rs. Maybe we just need a bash script to do this Like this.

curl -o $rootfs_tarball -L -C - "https://github.com/docker-library/busybox/raw/dist-${arch}/stable/glibc/busybox.tar.xz" 
tar -C $rootfs -xf $rootfs_tarball
proot-rs --rootfs $rootfs /bin/sh # or we can run `cargo test`

That makes sense. Do we need something like this to run the script before running the tests? https://github.com/sagiegurari/cargo-make

That's a good idea, I think we can try this