39 lines
1.5 KiB
Docker
39 lines
1.5 KiB
Docker
#syntax=docker/dockerfile:1
|
|
|
|
##
|
|
## Build
|
|
##
|
|
FROM rust:1-alpine3.19 AS build
|
|
LABEL org.opencontainers.image.authors="Sangbum Kim <sangbumkim@amuz.es>"
|
|
|
|
# set the workdir and copy the source into it
|
|
WORKDIR /app
|
|
COPY . /app
|
|
|
|
ENV RUSTFLAGS='-C link-arg=-s -C link-arg=-fuse-ld=lld'
|
|
|
|
RUN set -x && \
|
|
apk add --no-cache \
|
|
libcap-static \
|
|
libcap-dev \
|
|
lld \
|
|
musl-dev &&\
|
|
cargo build --release
|
|
# ldd target/release/setcap-static
|
|
|
|
# RUN --mount=type=bind,rw,source=.,target=/host \
|
|
# cp -avf target/release/setcap-static /host/setcap-static
|
|
|
|
|
|
FROM scratch
|
|
COPY --from=build /app/target/release/setcap-static /setcap-static
|
|
|
|
# buildah push e5bcd588c41f harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2-amd64
|
|
# podman push e051029260e7 harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2-arm64
|
|
# podman manifest create \
|
|
# harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2 \
|
|
# harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2-amd64 \
|
|
# harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2-arm64
|
|
# podman push 88cf0c74f harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2
|
|
# podman push 88cf0c74f harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0-latest
|
|
# podman push 88cf0c74f harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:latest |