Notes
main
main
  • Introduction
  • linuxKernel
    • tips
    • make_help
    • old linux
      • compile_linux0.11
      • TestEnvironment
      • load_setup
      • get_hard_data
    • list
    • plist
    • fifo
    • idr
    • xarray
    • rbtree
    • maple_tree
    • syscall
    • bitmap
    • page
    • page_flags
    • page_size
    • page mapcount
    • page refcount
    • folio
    • slub
      • proc_slabinfo
      • slub_theory
      • kmalloc_kfree
      • kmem_cache
      • slab_alloc
      • slab_free
      • proc_meminfo_SReclaimable_SReclaimable
    • vmalloc
    • brk
    • mmap
    • mremap
    • mprotect
    • madvise
    • read
    • write
    • shmem
    • huge_page
    • page_fault
    • rmap
    • lru
    • multi-gen-LRU
    • page_reclaim
    • page_cache
    • page_table
    • rcu
    • kvm
    • aarch64_boot
    • tracing_system
    • cache_coherence_and_memory_consistency
    • cpu_speculates
    • mmap_lock
    • per-vma_lock
    • cgroup
    • symbol
    • campact
    • page_ext
    • mempool
    • kernelstack
    • filesystem
    • io_stack
    • workingset
    • ioremap
    • sched_period
  • linuxDebug
    • openocd_openjtag
    • i2c_tools
    • objdump
    • addr2line
    • gdb_useage
    • debug_linux_kernel_via_gdb
    • debug_linux_module_via_gdb
    • early_boot
    • sequentially_execute
    • dynamic_debug
    • research_linuxKernel_by_patch
    • tracefs
    • ebpf
    • bpftrace
    • perf
    • flame_graph
    • crash
    • ASAN_HWASAN_MTE_check_mem_bug
    • page_owner
    • vmtouch
    • fio
    • benchmark
  • linuxSystem
    • common
      • system_version
      • procfs
      • proc_sys_vm
      • cmd_ps
      • makefile
      • file_descriptor
      • psi
      • ulimit
      • top
      • delay_accounting
    • ubuntu
      • custom_kernel
      • get_cmd_src
      • record_ssh_info
      • log
      • run_custom_script
      • repo
      • cockpit
      • nfs
      • tftp
      • misc
    • fedora
      • system_upgrade
      • custom_kernel
      • lvextend
      • yt-dlp
      • jellyfin
  • linuxDriver
    • i2c_peripherals_driver
    • spi_peripherals_driver
    • gpio_subsystem
    • IRQ_driver
    • blockIO_unblockIO_async
    • linux_own_driver
    • misc_device
    • input_device
    • timer
    • atomic_spinlock_semaphore_mutex
    • lcd
    • touch_screen
    • debugfs
    • v4l2
    • mmap
  • hardware
    • paging_mmu_pt
    • iommu
  • process_thread_scheduler
    • scheduler01
    • scheduler02
    • scheduler03
    • scheduler04
    • scheduler05
    • scheduler06
  • memory_management
    • mm1
    • mm2
    • mm3
    • mm4
    • mm5
  • input_output_filesystem
    • io_fs_01
    • io_fs_02
    • io_fs_03
    • io_fs_04
  • lock_and_lockup_detector
    • general_lock
    • hung_task
    • softLockup_hardLockup
    • crash_experiment
  • MIT_6.S081
    • 6.S081_Operating_System_Engineering
    • Schedule.md
    • Class
      • Overview
      • Administrivia
    • Labs
      • Tools
      • Guidance
      • startup
      • syscall
      • page_table
      • Calling_Convention
      • traps
    • xv6
      • xv6
    • References.md
  • qemu
    • qemu_buildroot
    • qemu_busybox.md
    • Serial.md
    • demo_mini2440
      • 0_compilation_error_summary
      • 1_compilation_steps
      • 2_operation_mode
      • 3_transplant_tools_libraries
      • 4_tools_use
      • reference_website
  • tools
    • getKernelSourceCodeList
    • nat
    • shell
    • translating
    • YouCompleteMe
    • cscope
    • global
    • vscode
    • vim
    • binary
    • markdown
    • draw
    • git
    • tig
    • tmux
    • mail_client
    • download_patchset_from_LKML
    • minicom
    • clash
  • other
    • interview
    • interview_c_base
    • know_dontknow
    • Stop-Ask-Questions-The-Stupid-Ways
    • How-To-Ask-Questions-The-Smart-Way
    • docker
    • buildroot
    • rv32_to_rv64
Powered by GitBook
On this page
  • 1. make images by dockerfile
  • 2. make images by commit
  • 3. 例子

Was this helpful?

  1. other

docker

1. make images by dockerfile

$ docker build -f <dockerfile> -t <image>:[tag] .

2. make images by commit

从容器中创建一个新镜像,并push to docker hub

$ docker commit -m "mesg" <CONTAINER ID> <image>:newtag
$ docker rmi <image>:latest
$ docker tag <image>:newtag <image>:latest
$ docker rmi <image>:newtag
$ docker push <image>:latest

3. 例子

在研究linux 0.11, linux2.6.34等版本时,因为历史原因过于久远,最新gcc版本过于高,很难编译通过,所以为了减少不必要的编译麻烦,需要用老gcc版本来编译linux源码,并且安装qemu进行仿真调试linux kernel源码。

为了将环境集成在一起,此处采用docker为x86_64/arm64安装编译与调试环境。

下载dockerfile文件对应的仓库,如下命令:

$ git clone https://github.com/vernon2gh/dockerfile.git
$ cd dockerfile
$ ls
dockerfile_linux2.x  dockerfile_linux3.x  dockerfile_linux4.x  dockerfile_linux5.x  dockerfile_oldlinux

制作编译与调试linux0.11的docker镜像,如下命令:

$ docker build -f dockerfile_oldlinux -t oldlinux:latest .

制作编译与调试linux 2.6.34/3.16/4.4/5.4的docker镜像,如下命令:

$ docker build -f <dockerfile_linux2/3/4/5.x> -t <linux-2/3/4/5.x>:latest .

附加说明

  • old linux docker

    安装 gcc 3.4版本

  • linux 2.x docker

    x86_64 安装 x86_64-linux-gnu-gcc 4.8.4/4.4 和 qemu-system-x86_64 2.0.0 版本

  • linux 3.x docker

    x86_64 安装 x86_64-linux-gnu-gcc 4.8.4 和 qemu-system-x86_64 2.0.0 版本

    arm64 安装 aarch64-linux-gnu-gcc 4.9.4 和 qemu-system-aarch64 2.4.1 版本

  • linux 4.x docker

    x86_64 安装 x86_64-linux-gnu-gcc 5.4.0 和 qemu-system-x86_64 2.5.0 版本

    arm64 安装 aarch64-linux-gnu-gcc 5.4.1 和 qemu-system-aarch64 2.5.0 版本

  • linux 5.x docker

    x86_64 安装 x86_64-linux-gnu-gcc 7.5.0 和 qemu-system-x86_64 2.11.1 版本

    arm64 安装 aarch64-linux-gnu-gcc 7.5.0 和 qemu-system-aarch64 2.11.1 版本

PreviousHow-To-Ask-Questions-The-Smart-WayNextbuildroot

Last updated 4 years ago

Was this helpful?