Rust implementation of OCI Distribution Spec with granular access control

fix: filter out buildah user warnings and improve error visibility

+13 -13
+13 -13
.tangled/workflows/build.yml
··· 28 28 29 29 - name: "Build and push container image" 30 30 command: | 31 - set -e # Exit on error 31 + set -ex # Exit on error and print commands 32 32 33 - # Create a container from distroless base 33 + # Suppress buildah user warnings by redirecting stderr for non-critical commands 34 34 echo "Creating container from distroless base..." 35 - container=$(buildah --storage-driver vfs from gcr.io/distroless/cc-debian12:nonroot) 35 + container=$(buildah --storage-driver vfs from gcr.io/distroless/cc-debian12:nonroot 2>&1 | tee /dev/stderr | grep -oP 'working-container-\d+' || buildah --storage-driver vfs from gcr.io/distroless/cc-debian12:nonroot) 36 36 echo "Container ID: $container" 37 37 38 38 # Copy the binaries 39 39 echo "Copying binaries..." 40 - buildah --storage-driver vfs copy $container target/release/grain /app/grain 41 - buildah --storage-driver vfs copy $container target/release/grainctl /app/grainctl 40 + buildah --storage-driver vfs copy $container target/release/grain /app/grain 2>&1 | grep -v "error determining current user" || true 41 + buildah --storage-driver vfs copy $container target/release/grainctl /app/grainctl 2>&1 | grep -v "error determining current user" || true 42 42 43 43 # Set configuration 44 44 echo "Configuring container..." 45 - buildah --storage-driver vfs config --workingdir /app $container 46 - buildah --storage-driver vfs config --env RUST_LOG=info $container 47 - buildah --storage-driver vfs config --port 8888 $container 48 - buildah --storage-driver vfs config --cmd '["/app/grain", "--host", "0.0.0.0:8888", "--users-file", "/data/users.json"]' $container 45 + buildah --storage-driver vfs config --workingdir /app $container 2>&1 | grep -v "error determining current user" || true 46 + buildah --storage-driver vfs config --env RUST_LOG=info $container 2>&1 | grep -v "error determining current user" || true 47 + buildah --storage-driver vfs config --port 8888 $container 2>&1 | grep -v "error determining current user" || true 48 + buildah --storage-driver vfs config --cmd '["/app/grain", "--host", "0.0.0.0:8888", "--users-file", "/data/users.json"]' $container 2>&1 | grep -v "error determining current user" || true 49 49 50 50 # Add labels 51 - buildah --storage-driver vfs config --label "org.opencontainers.image.source=https://tangled.org/@pierrelf.com/grain" $container 52 - buildah --storage-driver vfs config --label "org.opencontainers.image.description=Grain OCI Registry" $container 53 - buildah --storage-driver vfs config --label "org.opencontainers.image.version=${TANGLED_COMMIT_SHA:0:7}" $container 51 + buildah --storage-driver vfs config --label "org.opencontainers.image.source=https://tangled.org/@pierrelf.com/grain" $container 2>&1 | grep -v "error determining current user" || true 52 + buildah --storage-driver vfs config --label "org.opencontainers.image.description=Grain OCI Registry" $container 2>&1 | grep -v "error determining current user" || true 53 + buildah --storage-driver vfs config --label "org.opencontainers.image.version=${TANGLED_COMMIT_SHA:0:7}" $container 2>&1 | grep -v "error determining current user" || true 54 54 55 55 # Commit the container to an image 56 56 echo "Committing image..." 57 - buildah --storage-driver vfs commit $container grain:latest 57 + buildah --storage-driver vfs commit $container grain:latest 2>&1 | grep -v "error determining current user" 58 58 59 59 # Login and push to Docker Hub 60 60 echo "Logging in to Docker Hub..."