-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IMPROVEMENT-44: Create Dockerfile for deb package build process. (#51)
* IMPROVEMENT-44: Create dockerfile for deb package build process. * Refactor rpm dockerfile to get binary from './dist' instead of './build/dist'
- Loading branch information
1 parent
08a8b29
commit a420998
Showing
6 changed files
with
76 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Build stage | ||
FROM debian:12.4 as deb-build-stage | ||
ARG VERSION | ||
ENV CGO_ENABLED=0 | ||
ENV WORK_DIR="/build" | ||
ENV PACKAGE_SRC_ROOT="${WORK_DIR}/goto_${VERSION}_amd64" | ||
RUN apt update && apt install git build-essential golang-go -y | ||
WORKDIR "$WORK_DIR" | ||
RUN \ | ||
git clone --depth 1 --branch v${VERSION} https://github.com/grafviktor/goto.git . && \ | ||
make build | ||
ADD build/deb/goto.control /tmp/ | ||
RUN \ | ||
mkdir -p ${PACKAGE_SRC_ROOT}/DEBIAN && \ | ||
cp /tmp/goto.control ${PACKAGE_SRC_ROOT}/DEBIAN/control && \ | ||
sed -i "s/%VERSION%/$VERSION/g" ${PACKAGE_SRC_ROOT}/DEBIAN/control && \ | ||
mkdir -p ${PACKAGE_SRC_ROOT}/usr/bin && \ | ||
cp ./dist/gg ${PACKAGE_SRC_ROOT}/usr/bin && \ | ||
dpkg-deb -v --build "${WORK_DIR}/goto_${VERSION}_amd64" | ||
RUN \ | ||
dpkg -i goto_${VERSION}_amd64.deb && \ | ||
gg -v | ||
|
||
|
||
# Export stage | ||
FROM scratch AS export-stage | ||
ARG VERSION | ||
ENV WORK_DIR="/build" | ||
COPY --from=deb-build-stage ${WORK_DIR}/goto_${VERSION}_amd64.deb . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Package: goto | ||
Version: %VERSION% | ||
Architecture: amd64 | ||
Essential: no | ||
Priority: optional | ||
Maintainer: Roman Leonenkov <[email protected]> | ||
Description: This utility helps to maintain a list of ssh servers. Unlike PuTTY it doesn't incorporate any connection logic, but relying on openssh package which should be installed on your system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters