Docker builds with uid/gid 0 (root)

Đang mở
#968 26 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
docker, java, sqlite
Lĩnh vực
build-system

Hướng nghiên cứu

Start with the Makefile targets native-all and linux-musl-arm64, especially the Docker invocation around line 125 mentioned in the logs. Reproduce the build and inspect ownership of /target before and after it runs. Done means the native build completes without a permission error and output files are owned by the invoking user.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement:build

Describe the bug
When building native binaries via make native-all, output directories in /target have root user permissions (uid 0, gid 0) resulting in build error Permission denied

To Reproduce

  1. From linux environment, run make native-all
  2. Check directory permissions after build fails

Expected behavior
building via dockcross should utilize the user id and group id from the shell of the user executing it such that their output matches that of the user.

e.g.

// Makefile

U_ID:="$(shell id -u)"
G_ID:="$(shell id -g)"

// For all other architectures as shown in attached image
linux64: $(SQLITE_UNPACKED) jni-header
	docker run $(DOCKER_RUN_OPTS) -u "$(U_ID):$(G_ID)" .......

Logs

mkdir: cannot create directory 'target/classes/org/sqlite/native/Linux-Musl/aarch64': Permission denied
make: *** [Makefile:125: src/main/resources/org/sqlite/native/Linux-Musl/aarch64/libsqlitejdbc.so] Error 1
make: *** [Makefile:162: linux-musl-arm64] Error 2

Environment (please complete the following information):

  • OS:
    $ cat /etc/os-release
    NAME="Pop!_OS"
    VERSION="22.04 LTS"
    ID=pop
    ID_LIKE="ubuntu debian"
    PRETTY_NAME="Pop!_OS 22.04 LTS"
    VERSION_ID="22.04"
    HOME_URL="https://pop.system76.com"
    SUPPORT_URL="https://support.system76.com"
    BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
    PRIVACY_POLICY_URL="https://system76.com/privacy"
    VERSION_CODENAME=jammy
    UBUNTU_CODENAME=jammy
    LOGO=distributor-logo-pop-os
    
  • CPU architecture: x86_64
  • sqlite-jdbc version: 3.43.0.0

Additional context
image

Ngôn ngữ chính
Java
Star
3.3k
Fork
676
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của xerial/sqlite-jdbc

Tất cả issue của xerial/sqlite-jdbc

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.