This is for educational purpose only. please use original version from jlesage. Thanks to him
1.3K
This is a docker baseimage that can be used to create containers for any long-lived application.
Different docker images are available:
| Base Distribution | Docker Image Base Tag |
|---|---|
| Alpine 3.18.4 | alpine-3.18.4 |
| Ubuntu 22.04 LTS | ubuntu-22.04 |
Here are the main components of the baseimage:
Images are versioned. Version number follows the semantic versioning. The
version format is MAJOR.MINOR.PATCH, where an increment of the:
MAJOR version indicates that a backwards-incompatible change has been done.MINOR version indicates that functionality has been added in a backwards-compatible manner.PATCH version indicates that a bug fix has been done in a backwards-compatible manner.For each distribution-specific image, multiple tags are available:
| Tag | Description |
|---|---|
| distro-vX.Y.Z | Exact version of the image. |
| distro-vX.Y | Latest version of a specific minor version of the image. |
| distro-vX | Latest version of a specific major version of the image. |
The Dockerfile for your application can be very simple, as only three things
are required:
/startapp.sh in
container).Here is an example of a docker file that would be used to run a simple web
NodeJS server.
In Dockerfile:
# Pull base image.
FROM imodstyle/baseimage:alpine-3.18
# Install http-server.
RUN add-pkg nodejs-npm && \
npm install http-server -g
# Copy the start script.
COPY startapp.sh /startapp.sh
# Set the name of the application.
RUN set-cont-env APP_NAME "http-server"
# Expose ports.
EXPOSE 8080
In startapp.sh:
#!/bin/sh
exec /usr/bin/http-server
Then, build your docker image:
docker build -t docker-http-server .
And run it:
docker run --rm -p 8080:8080 docker-http-server
You should be able to access the HTTP server by opening in a web browser:
http://[HOST IP ADDR]:8080
Full documentation is available at https://github.com/imodstyle/docker-baseimage.
Content type
Image
Digest
sha256:7308bcd1f…
Size
29.7 MB
Last updated
over 2 years ago
docker pull imodstyle/baseimage:ubuntu-22.04-v3.6.1