[LINUX] Programs that use io_uring do not work with Docker on CentOS 8

There is an asynchronous IO kernel function called io_uring introduced from Linux kernel 5.1, but the Docker image that uses it does not work on CentOS 8. Well, for those who know it, that's right.

As a rationale if you want to argue that the portability of Docker/Linux containers isn't all-purpose.

io_uring Create a program to use on Ubuntu 20.10.

    1. Create a virtual machine with an OS of Ubuntu 20.10. https://ubuntu.com/download
    1. Install Docker. https://docs.docker.com/engine/install/ubuntu/
    1. Launch the Ubuntu 20.10 image on Docker.

20.10 bash



 4. For the time being, check the kernel in use with uname -a.
```(c)# uname -a```

(Execution result) root@17003dd74a2f:/liburing/examples# uname -a Linux 17003dd74a2f 5.8.0-33-generic #36-Ubuntu SMP Wed Dec 9 09:14:40 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


 5. Install gcc and io_uring libraries, git.
```(c)# apt-get update```
```(c)# apt-get install -y build-essential liburing-dev git```

 6. Get the sample program of io_uring.
https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework

#### **`(c)# git clone https://github.com/axboe/liburing.git`**
  1. Compile the sample program. (c)# cd liburing/examples

(c)# gcc -Wall -O2 -D_GNU_SOURCE -o io_uring-test io_uring-test.c -luring



 8. Run the program. Of course, this works.

#### **`(c)# ./io_uring-test io_uring-test.c`**
(Execution result)
root@08ad6f4c804c:/liburing/examples# ./io_uring-test io_uring-test.c
Submitted=1, completed=1, bytes=2256
  1. Detach (C-p, C-q) from the container, commit, and save the image. # docker commit io_uring-test io_uring-test

# docker save io_uring-test -o io_uring-test.tar



# Run the program on CentOS 8 Docker

 1. 1. Create a virtual machine whose OS is CentOS 8.3.
https://www.centos.org/download/

 2. 2. Install Docker.
https://docs.docker.com/engine/install/centos/

 3. 3. Copy the previous Docker image (io_uring-test.tar) to your CentOS 8 machine and load it.

#### **`# docker load -i io_uring-test.tar`**
```tar


 4. Start the container.
```# docker run -it --rm io_uring-test bash```

 5. For the time being, check the kernel in use with uname -a. It should be 4.18, the same as the host CentOS 8.
```(c)# uname -a```

(Execution result) root@824c737193b6:/# uname -a Linux 824c737193b6 4.18.0-240.1.1.el8_3.x86_64 #1 SMP Thu Nov 19 17:20:08 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

(By the way) root@824c737193b6:/liburing/examples# cat /etc/os-release NAME="Ubuntu" VERSION="20.10 (Groovy Gorilla)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.10" VERSION_ID="20.10" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=groovy UBUNTU_CODENAME=groovy




 5. Run the sample program.
```(c)# cd liburing/examples/```

#### **`(c)# ./io_uring-test io_uring-test.c`**
(Execution result)
root@824c737193b6:/liburing/examples# ./io_uring-test io_uring-test.c
queue_init: Function not implemented

Well, it doesn't work.

Recommended Posts

Programs that use io_uring do not work with Docker on CentOS 8
WordPress with Docker Compose on CentOS 8
Use Docker CE (official) on CentOS 8
Docker installation on CentOS 6
Use perltidy on CentOS 8
Use Puphpeteer with Docker
Use mod_auth_cas on CentOS 8
Use CentOS with LXD
Use ngrok with Docker
Use bat on Centos.
What to do when routing settings do not work after building Docker environment with Laravel
File upload with Spring Boot (do not use Multipart File)
Convenient use of Map that you do not know unexpectedly
Use GDAL with Python with Docker
[Docker] Use whenever with Docker + Rails
Test with ArchUnit that "reference operation depends on QueryService, not Repository"
Install metrics-server with Helm on Kubernetes that comes with Docker for Mac
Why use orchestration tools with Docker
Use Docker Compose on Windows 10 Home
[Java] Do not use "+" in append!
Use Docker on your M1 Mac
Use the iostat command on CentOS 8
Use cuda11.0 with pytorch using Docker
What to do when CentOS cannot be started with VirtualBox on Catalina
Ignore parameters that do not exist in the model with ObjectMapper # readValue