Dockerfile

Build Image

Basic build command

cd /path/to/Dockerfile
docker build -t your-tag/your-name .
Set the version

More details: docker-bookstack/Dockerfile at master · linuxserver/docker-bookstack · GitHub

FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17

# set version label
ARG BUILD_DATE
ARG VERSION
ARG BOOKSTACK_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="homerr"

使用方法:

Build the image

docker build \
  --build-arg BUILD_DATE=$( date +"%FT%T%z" ) \
  --build-arg VERSION=v22.07.3-ls36 \
  --no-cache \
  --pull \
  -t lscr.io/linuxserver/bookstack:latest .

Get the version of container

docker inspect -f '{{ index .Config.Labels "build_version" }}' <container-name>

Learning

Revision #10
Created 15 October 2020 20:12:02 by Admin
Updated 3 August 2023 15:36:30 by Admin