Error running docker-compose (unsupported config ‘cpuset’ and operation not permitted)

I’m currently using older versions of docker and docker-compose on my server running RHEL 7.9.

Docker version 1.13.1, build 0be3e21/1.13.1
docker-compose version 1.18.0, build 8dd22a9

My docker-compose.yml is as follows (I’m only showing parts of the file):

version: '3'
services:
  fc-1:
    image: fc
    cpuset: '0,2,4,6,8,10'
    container_name: 'fc-1'
    restart: 'unless-stopped'
    network_mode: 'host'
    volumes:
      - /etc/fc:/etc/fc
    environment:
      ...
  fc-2:
    image: fc
    cpuset: '1,3,5,7,9,11'
    container_name: 'fc-2'
    restart: 'unless-stopped'
    network_mode: 'host'
    volumes:
      - /etc/fc:/etc/fc
    environment:
      ...

There are 2 problems.

First, when I run docker-compose up, I get the following error:

ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.fc-1: 'cpuset'
Unsupported config option for services.fc-2: 'cpuset'

If I comment out the cpuset lines, I still cannot run it as I would get the error

runtime/cgo: pthread_create failed: Operation not permitted
SIGABRT: abort

Is this because my docker and docker-compose are too old? Would newer versions of docker still work with RHEL7? Is there any work around?

I read that I could run the container with --security-opt seccomp=unconfined, but where do I put this in the docker-compose.yml file?

ETA: I found, though using the Composerize website, that the correct way to run the container with --security-opt seccomp=unconfined, is the following:

services:
    fc-1:
        image: fc-1
        security_opt:
            - seccomp=unconfined

And to solve the cpuset issue, was to use a lower version (2 instead of 3), like @David Maze said.

Compose files version 2 and 3 support different sets of options. You’ve declared version: '3' (so version 3.0); version 3’s options are more oriented towards Docker Swarm, and don’t include cpuset:. Version 2 is more oriented towards single-host operation and more directly reproduces more docker run options, including cpuset:.

If you want cpuset: to work, then you need to declare your file to use version 2 of the Compose file format

version: '2.4' # <-- change
services:
  fc-1:
    cpuset: '0,2,4,6,8,10'

(In practice this isn’t an option you should need often. The Linux kernel does a good job of assigning processes to CPU cores and there’s usually not a benefit to trying to override it.)

If you’re able to upgrade to version 2 of the Compose tool, that uses a newer “Compose Specification” format which completely ignores version:, but includes the options from both the version 2 and 3 file formats with some further additions (more specifically, including cpuset:). I tend to write version: '4.x' in files that require its functionality. If that upgrade is possible for you then it probably would also solve this problem.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật