Skip to content

Lab 0: Environment Set up

Screenshot 2023-10-20 at 02.22.33

In this lab I use docker with ubuntu to finish.

$ docker pull ubuntu
$ docker container run -it --platform linux/amd64 -v /Users/eve/Desktop/CS/Computer\ Architecture/CSAPP/Labs/Lab1_Data/Code:/datalab-handout --name=csapp_env ubuntu /bin/bash
$ 

/Users/eve/Desktop/CS/Computer\ Architecture/CSAPP/Labs/Lab1_Data/Code is the path

:/datalab-handout is my file name.

Docker默认创建的是arm架构的Ubuntu,如果没有指定为amd64,将无法安装gcc -m32

https://zhuanlan.zhihu.com/p/339047608?utm_id=0

https://blog.csdn.net/weixin_52693116/article/details/133149517

https://blog.csdn.net/weixin_44071773/article/details/120785642

Screenshot 2023-10-20 at 03.12.28

Screenshot 2023-10-20 at 02.56.51

$ apt-get update
$ apt-get install sudo
$ sudo apt-get install build-essential
$ sudo apt-get install gcc-multilib
$ sudo apt-get install gdb

Screenshot 2023-10-20 at 03.17.53

进入容器

$ docker container ls
$ docker exec -it 1573 bash
root

Screenshot 2023-12-24 at 18.09.19

Screenshot 2023-12-24 at 19.48.59