Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ğ
Ğcli-v2s
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Rust
Ğcli-v2s
Commits
27de71ba
Commit
27de71ba
authored
10 months ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
build debian package in docker
parent
bfb85c07
No related branches found
No related tags found
1 merge request
!32
Draft: build debian package
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile.deb
+17
-0
17 additions, 0 deletions
Dockerfile.deb
docker/build.sh
+4
-14
4 additions, 14 deletions
docker/build.sh
docker/debian.sh
+12
-0
12 additions, 0 deletions
docker/debian.sh
with
33 additions
and
14 deletions
Dockerfile.deb
0 → 100644
+
17
−
0
View file @
27de71ba
# build based on debian buster to build debian package
FROM rust:slim-buster
WORKDIR /app
RUN --mount=type=cache,target=/root/.cargo \
cargo install cargo-deb
COPY Cargo.toml Cargo.lock ./
RUN --mount=type=cache,target=/app/target \
--mount=type=cache,target=/root/.cargo/registry \
mkdir src \
&& echo "fn main() {}" > src/main.rs \
&& cargo build --release \
&& rm -r src
COPY ./res ./res
COPY ./src ./src
RUN cargo build --release
RUN cargo deb --no-build
RUN rm -r /app/target/release
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker/build.sh
+
4
−
14
View file @
27de71ba
#!/bin/
ba
sh
#!/bin/sh
# Also generated by chatGPT
IMAGE_NAME
=
gcli
IMAGE_VERSION
=
latest
# Name of your Docker image
docker buildx build
-t
$IMAGE_NAME
:
$IMAGE_VERSION
.
IMAGE_NAME
=
"gcli"
# Version of your Docker image
IMAGE_VERSION
=
"latest"
# Build and tag the Docker image using Docker Buildx
docker buildx build
-t
"
$IMAGE_NAME
:
$IMAGE_VERSION
"
.
# Optionally, you can push the image to a Docker registry
# docker push "$IMAGE_NAME:$IMAGE_VERSION"
This diff is collapsed.
Click to expand it.
docker/debian.sh
0 → 100755
+
12
−
0
View file @
27de71ba
#!/bin/sh
# build debian package
VERSION
=
0.2.10-1
IMAGE_NAME
=
gcli_deb
IMAGE_VERSION
=
latest
docker buildx build
-f
Dockerfile.deb
-t
$IMAGE_NAME
:
$IMAGE_VERSION
.
mkdir
-p
./target/debian
id
=
$(
docker create
$IMAGE_NAME
:
$IMAGE_VERSION
)
docker
cp
$id
:/app/target/debian/gcli_
${
VERSION
}
_amd64.deb ./target/debian
docker
rm
-v
$id
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment