Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer Debian for smaller base image? #6

Open
benmccann opened this issue Nov 19, 2014 · 1 comment
Open

Offer Debian for smaller base image? #6

benmccann opened this issue Nov 19, 2014 · 1 comment

Comments

@benmccann
Copy link

I'm wondering if it would be helpful to use a smaller base image. Which OS you choose as a base to your Dockerfile can affect how long it takes to pull an image on a fresh machine. Using Debian instead of Ubuntu would save over 100MB. When I use dockerfile/java or any of the other images, there's really no benefit to having the larger Ubuntu instead of Debian even though I use Ubuntu for most of my day-to-day work.

@ljluestc
Copy link

ljluestc commented Sep 4, 2023

# Use a smaller base image like Debian
FROM debian:buster

# Set the environment variables to configure the locale
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# Install Java runtime and other dependencies
RUN apt-get update && apt-get install -y openjdk-11-jre-headless

# Copy your application JAR or files into the container
COPY your-app.jar /app/

# Specify the working directory
WORKDIR /app

# Specify the command to run your Java application
CMD ["java", "-jar", "your-app.jar"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants