-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dockerfile for release build, fix: add .DS_Store to .gitignore
- Loading branch information
1 parent
7788225
commit 9cb2103
Showing
3 changed files
with
74 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/target | ||
doc/screenshotter/target | ||
*.charm | ||
|
||
*.DS_Store |
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,41 @@ | ||
# Use the official Ubuntu 24.04 image as the base | ||
FROM ubuntu:24.04 | ||
|
||
# Set environment variables to non-interactive to avoid prompts during apt-get install | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Update and install required dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
libgtk-4-dev \ | ||
libgdk-pixbuf2.0-dev \ | ||
libatk1.0-dev \ | ||
libcairo2-dev \ | ||
libjpeg8-dev \ | ||
libpango1.0-dev \ | ||
libgif-dev \ | ||
libgraphene-1.0-dev \ | ||
build-essential \ | ||
g++ \ | ||
curl \ | ||
git \ | ||
pkg-config \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Rust | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Clone the GitHub repo | ||
RUN git clone https://github.com/misson20000/charm.git /charm | ||
|
||
# Set the working directory | ||
WORKDIR /charm | ||
|
||
# Build the repo using Cargo in release mode | ||
RUN cargo build --release -F gtk | ||
|
||
# Output the resulting build file | ||
CMD ["sh", "-c", "cp -r /charm/target/* /output && ls /output"] | ||
|
||
# Set the output directory | ||
VOLUME ["/output"] |
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,32 @@ | ||
#!/bin/bash | ||
|
||
# Define variables | ||
DOCKER_IMAGE_NAME="charm-builder" | ||
OUTPUT_DIR="./output" | ||
|
||
# Step 1: Build the Docker image | ||
echo "Building Docker image..." | ||
docker build -t $DOCKER_IMAGE_NAME . | ||
|
||
# Check if the build was successful | ||
if [ $? -ne 0 ]; then | ||
echo "Docker image build failed." | ||
exit 1 | ||
fi | ||
|
||
# Step 2: Create the output directory if it doesn't exist | ||
if [ ! -d $OUTPUT_DIR ]; then | ||
mkdir -p $OUTPUT_DIR | ||
fi | ||
|
||
# Step 3: Run the Docker container to build the Rust project and output the build files | ||
echo "Running Docker container..." | ||
docker run --rm -v $(pwd)/output:/output $DOCKER_IMAGE_NAME | ||
|
||
# Check if the container run was successful | ||
if [ $? -ne 0 ]; then | ||
echo "Docker container run failed." | ||
exit 1 | ||
fi | ||
|
||
echo "Build completed successfully. Output files are located in the 'output' directory." |