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

wip dockerfile

TODO make duniter-polkadot-sdk repo lighter to avoid long download time in docker build
parent ae6b4202
No related branches found
No related tags found
No related merge requests found
target/
# This Dockerfile was generated by chatGPT and then modified
# Use the official Rust image as the base image for building
FROM rust:latest as build
# # Use musl Rust image
# FROM clux/muslrust:1.75.0-stable as build
# Create a new directory for our application code inside the container
WORKDIR /usr/src/gcli
# Copy the Cargo.toml and Cargo.lock files to leverage Docker's caching mechanism
COPY Cargo.toml Cargo.lock ./
# Build the dependencies of the application separately
RUN mkdir src \
&& echo "fn main() {}" > src/main.rs \
&& cargo build --release \
&& rm -r src
# Copy the rest of the source code
COPY ./res ./res
COPY ./src ./src
# Build the application
RUN cargo build --release
# # Start realease stage
# FROM alpine:latest as release
# # Set the working directory to the location of the built application
# WORKDIR /usr/bin/gcli
# # Copy the built application from the previous stage
# COPY --from=build /usr/src/gcli/target/release/gcli .
# # Specify the entrypoint for the container
# ENTRYPOINT ["./gcli"]
\ No newline at end of file
# Docker
Docker image for gcli is useful for people with docker-based infrastructure or old system with old glibc or libssl.
## Build
```sh
./docker/build.sh
```
## Use
An alias can be useful:
```sh
alias gcli="docker run gcli"
```
Keep in mind that gcli stores its config and vault, you can mount volumes on these.
\ No newline at end of file
#!/bin/bash
# Also generated by chatGPT
# Name of your Docker image
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"
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