dockerfile / ubuntu

Ubuntu Dockerfile for trusted automated Docker builds.
http://dockerfile.github.io/#/ubuntu
MIT License
459 stars 1.28k forks source link

Offer Debian for smaller base image? #6

Open benmccann opened 9 years ago

benmccann commented 9 years ago

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 commented 1 year ago
# 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"]