Docker builds with uid/gid 0 (root)

Abierto
#968 26 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
docker, java, sqlite
Área
build-system

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Java
Estrellas
3.3k
Forks
676
Merge medio
1 d 15 h
PR fusionados (30 d)
18

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de xerial/sqlite-jdbc

Todos los issues de xerial/sqlite-jdbc

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.