Rust implementation of OCI Distribution Spec with granular access control

debug: add verbose logging and error handling to buildah commands

+14
+14
.tangled/workflows/build.yml
··· 28 28 29 29 - name: "Build and push container image" 30 30 command: | 31 + set -e # Exit on error 32 + 31 33 # Create a container from distroless base 34 + echo "Creating container from distroless base..." 32 35 container=$(buildah --storage-driver vfs from gcr.io/distroless/cc-debian12:nonroot) 36 + echo "Container ID: $container" 33 37 34 38 # Copy the binaries 39 + echo "Copying binaries..." 35 40 buildah --storage-driver vfs copy $container target/release/grain /app/grain 36 41 buildah --storage-driver vfs copy $container target/release/grainctl /app/grainctl 37 42 38 43 # Set configuration 44 + echo "Configuring container..." 39 45 buildah --storage-driver vfs config --workingdir /app $container 40 46 buildah --storage-driver vfs config --env RUST_LOG=info $container 41 47 buildah --storage-driver vfs config --port 8888 $container ··· 47 53 buildah --storage-driver vfs config --label "org.opencontainers.image.version=${TANGLED_COMMIT_SHA:0:7}" $container 48 54 49 55 # Commit the container to an image 56 + echo "Committing image..." 50 57 buildah --storage-driver vfs commit $container grain:latest 51 58 52 59 # Login and push to Docker Hub 60 + echo "Logging in to Docker Hub..." 53 61 echo "$DOCKER_PASS" | buildah --storage-driver vfs login --username "$DOCKER_USER" --password-stdin docker.io 62 + 63 + echo "Pushing image to docker.io/pierrelf/grain:latest..." 54 64 buildah --storage-driver vfs push grain:latest docker://docker.io/pierrelf/grain:latest 65 + 66 + echo "Pushing image to docker.io/pierrelf/grain:${TANGLED_COMMIT_SHA:0:7}..." 55 67 buildah --storage-driver vfs push grain:latest docker://docker.io/pierrelf/grain:${TANGLED_COMMIT_SHA:0:7} 68 + 69 + echo "Build and push completed successfully!"