Skip to content
Snippets Groups Projects
Commit 27de71ba authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

build debian package in docker

parent bfb85c07
No related branches found
No related tags found
1 merge request!32Draft: build debian package
# 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
#!/bin/bash #!/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"
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment