LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-25-2023, 10:06 PM   #1
tiashi
LQ Newbie
 
Registered: Nov 2022
Location: Moon
Posts: 25

Rep: Reputation: 0
How to choose the Debian docker images with building Rust


Hi friends,

I'm currently working on a Rust project and trying to run it within a Debian docker container. However, I've encountered a challenge when trying to match the Rust version with the appropriate Debian version. Specifically, I am using rust:1.71.0 with debian:buster-slim, and this combination is leading to the following error:

Code:
/lib/x86_64-linux-gnu/libm.so.6: version 'GLIBC_2.29' not found (required by ./
May I ask where can I get all the Debian images info, like ldd version or do you have any advice on it?

Thanks in advance!
 
Old 07-26-2023, 01:22 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,022

Rep: Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343
would be nice to give us more details. What did you try, where is this message coming from?
http://www.catb.org/~esr/faqs/smart-...html#beprecise
 
Old 07-27-2023, 05:25 AM   #3
tiashi
LQ Newbie
 
Registered: Nov 2022
Location: Moon
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
would be nice to give us more details. What did you try, where is this message coming from?
http://www.catb.org/~esr/faqs/smart-...html#beprecise
thanks for the reference. LOL.

I'm deploying my Rust program via Dockerfile and it works with the following Debian version now:

Code:
# Use the official Rust image as the base image for building
FROM rust:1.71.0 AS builder

## Use rust 1.71.0 for using lettre higher version 

# Set the working directory inside the container
WORKDIR /app

# Copy the source code into the container
COPY . .

# Fix the code, only do this in Production
RUN cargo fix 

# Build the Rust code
RUN cargo build --release

# Start a new stage for the actual application
#FROM debian:buster-slim
# https://www.linuxquestions.org/questions/showthread.php?p=6444333#post6444333
FROM debian:bullseye

# Install dependencies for running the application (e.g., cron)
RUN apt-get update && apt-get install -y cron

# Set the working directory inside the container
WORKDIR /app

# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/release/app_name /app/app_name
RUN chmod +x /app/app_name
# Copy the .env file into the container
COPY .env /app/.env

# Add crontab setting directly in the Dockerfile
RUN echo "*/15 * * * * root cd /app; /app/app_name >> runlog_ app_name_\`date +\\\%Y\\\%m\\\%d\`.log 2>&1 &" >> /etc/cron.d/app_name
RUN chmod 0644 /etc/cron.d/app_name

# Start the cron service when the container starts
CMD ["cron", "-f"]
I got that error with using debian:buster-slim for the stage running the Rust bin code. So I'm wondering how we can get the correct Debian version with a certain version of Rust.
 
  


Reply

Tags
debian, docker



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Difference between docker.io, docker-cd, and Docker Desktop LXer Syndicated Linux News 0 08-15-2022 05:39 PM
LXer: Rust Foundation launches Rust Community Grants program LXer Syndicated Linux News 0 04-01-2022 03:30 PM
LXer: How To Install Docker And Pull Images From Docker Hub LXer Syndicated Linux News 0 10-26-2020 01:03 AM
LXer: Docker Part 4: building and publishing custom docker images LXer Syndicated Linux News 0 04-08-2016 01:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration