Skip to content

Commit 8acfd13

Browse files
committed
refactor(docker): Consolidate RUN commands in RPM build Dockerfile
Combine build script creation and chmod into a single RUN instruction to reduce Docker image layers and improve build efficiency.
1 parent a2d4964 commit 8acfd13

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

support/rpm/Dockerfile.rpmbuild

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ WORKDIR /workspace
3333
COPY . /workspace/
3434

3535
# Create build script
36-
RUN cat > /build-rpm.sh << 'EOF'
36+
RUN cat > /build-rpm.sh << 'EOF' && chmod +x /build-rpm.sh \
37+
&& echo "Build script created successfully"
3738
#!/bin/bash
3839
set -e
3940

@@ -94,7 +95,5 @@ else
9495
fi
9596
EOF
9697

97-
RUN chmod +x /build-rpm.sh
98-
9998
# Build script
10099
CMD ["/bin/bash", "/build-rpm.sh"]

0 commit comments

Comments
 (0)