Skip to content

Commit 453e5be

Browse files
committed
Add Dockerfile.deb to git (was ignored)
1 parent b1bc465 commit 453e5be

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ deb-amd64: ## build .deb package for amd64
5050
--build-arg RELEASE_NUM=$(RELEASE_NUM) \
5151
--cache-from type=local,src=/tmp/.buildx-cache \
5252
--cache-to type=local,dest=/tmp/.buildx-cache \
53-
-f ci/build_image/Dockerfile.deb \
53+
-f ci/build_image/Dockerfile.build_deb \
5454
--target deb-only \
5555
-t aci-builder-amd64 \
5656
--load .
@@ -67,7 +67,7 @@ deb-arm64: ## build .deb package for arm64
6767
--build-arg RELEASE_NUM=$(RELEASE_NUM) \
6868
--cache-from type=local,src=/tmp/.buildx-cache \
6969
--cache-to type=local,dest=/tmp/.buildx-cache \
70-
-f ci/build_image/Dockerfile.deb \
70+
-f ci/build_image/Dockerfile.build_deb \
7171
--target deb-only \
7272
-t aci-builder-arm64 \
7373
--load .
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright The Accelerated Container Image Authors
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# build overlaybd-snapshotter
16+
ARG GO_VERSION
17+
ARG GO_IMAGE=golang:${GO_VERSION}
18+
FROM --platform=${BUILDPLATFORM} ${GO_IMAGE} AS builder
19+
WORKDIR /src
20+
# Copy go.mod and go.sum first for better layer caching
21+
COPY go.mod go.sum ./
22+
ENV DEBIAN_FRONTEND=noninteractive
23+
RUN echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list && \
24+
apt update && \
25+
apt install -y nfpm && \
26+
go mod download
27+
# Copy the rest of the source code
28+
COPY . .
29+
30+
ARG TARGETOS TARGETARCH
31+
ENV GOOS=${TARGETOS}
32+
ENV GOARCH=${TARGETARCH}
33+
ARG RELEASE_VERSION
34+
ENV SEMVER=${RELEASE_VERSION}
35+
ARG RELEASE_NUM
36+
ENV RELEASE=${RELEASE_NUM}
37+
ENV COMMIT_ID="${RELEASE_VERSION}_${RELEASE_NUM}"
38+
RUN make && \
39+
nfpm pkg --packager deb --target /tmp/ && \
40+
nfpm pkg --packager rpm --target /tmp/
41+
42+
# minimal image for deb extraction
43+
FROM ubuntu:24.04 AS deb-only
44+
WORKDIR /app
45+
COPY --from=builder /tmp/overlaybd-snapshotter_*.deb .

0 commit comments

Comments
 (0)