docker: added OCI-compatible image labels
See https://github.com/opencontainers/image-spec/blob/master/annotations.md
This commit is contained in:
		
							parent
							
								
									91f5a42459
								
							
						
					
					
						commit
						9c04400369
					
				@ -29,3 +29,16 @@ COPY --from=approot / /
 | 
			
		||||
 | 
			
		||||
CMD ["/docker-start.sh"]
 | 
			
		||||
VOLUME ["/data"]
 | 
			
		||||
 | 
			
		||||
ARG DOCKER_REPO
 | 
			
		||||
ARG BUILD_DATE
 | 
			
		||||
ARG SOURCE_COMMIT
 | 
			
		||||
LABEL \
 | 
			
		||||
    maintainer="" \
 | 
			
		||||
    org.opencontainers.image.title="${DOCKER_REPO}" \
 | 
			
		||||
    org.opencontainers.image.url="https://github.com/rr-/szurubooru" \
 | 
			
		||||
    org.opencontainers.image.documentation="https://github.com/rr-/szurubooru/blob/${SOURCE_COMMIT}/doc/INSTALL.md" \
 | 
			
		||||
    org.opencontainers.image.created="${BUILD_DATE}" \
 | 
			
		||||
    org.opencontainers.image.source="https://github.com/rr-/szurubooru" \
 | 
			
		||||
    org.opencontainers.image.revision="${SOURCE_COMMIT}" \
 | 
			
		||||
    org.opencontainers.image.licenses="GPL-3.0"
 | 
			
		||||
 | 
			
		||||
@ -1,11 +1,16 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
CLOSEST_VER=$(git describe --tags --abbrev=0)
 | 
			
		||||
if git describe --exact-match --abbrev=0 2> /dev/null; then
 | 
			
		||||
CLOSEST_VER=$(git describe --tags --abbrev=0 ${SOURCE_COMMIT})
 | 
			
		||||
if git describe --exact-match --abbrev=0 ${SOURCE_COMMIT} 2> /dev/null; then
 | 
			
		||||
	BUILD_INFO="v${CLOSEST_VER}"
 | 
			
		||||
else
 | 
			
		||||
	BUILD_INFO="v${CLOSEST_VER}-edge-$(echo $SOURCE_COMMIT | cut -c1-7)"
 | 
			
		||||
	BUILD_INFO="v${CLOSEST_VER}-edge-$(git rev-parse --short ${SOURCE_COMMIT})"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "Using BUILD_INFO=$BUILD_INFO"
 | 
			
		||||
docker build --build-arg BUILD_INFO=$BUILD_INFO -f $DOCKERFILE_PATH -t $IMAGE_NAME .
 | 
			
		||||
echo "Using BUILD_INFO=${BUILD_INFO}"
 | 
			
		||||
docker build \
 | 
			
		||||
	--build-arg BUILD_INFO \
 | 
			
		||||
	--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
 | 
			
		||||
	--build-arg SOURCE_COMMIT \
 | 
			
		||||
	--build-arg DOCKER_REPO \
 | 
			
		||||
	-f $DOCKERFILE_PATH -t $IMAGE_NAME .
 | 
			
		||||
 | 
			
		||||
@ -42,3 +42,16 @@ ENV PORT=${PORT}
 | 
			
		||||
EXPOSE ${PORT}
 | 
			
		||||
VOLUME ["/data/"]
 | 
			
		||||
CMD ["/opt/app/docker-start.sh"]
 | 
			
		||||
 | 
			
		||||
ARG DOCKER_REPO
 | 
			
		||||
ARG BUILD_DATE
 | 
			
		||||
ARG SOURCE_COMMIT
 | 
			
		||||
LABEL \
 | 
			
		||||
    maintainer="" \
 | 
			
		||||
    org.opencontainers.image.title="${DOCKER_REPO}" \
 | 
			
		||||
    org.opencontainers.image.url="https://github.com/rr-/szurubooru" \
 | 
			
		||||
    org.opencontainers.image.documentation="https://github.com/rr-/szurubooru/blob/${SOURCE_COMMIT}/doc/INSTALL.md" \
 | 
			
		||||
    org.opencontainers.image.created="${BUILD_DATE}" \
 | 
			
		||||
    org.opencontainers.image.source="https://github.com/rr-/szurubooru" \
 | 
			
		||||
    org.opencontainers.image.revision="${SOURCE_COMMIT}" \
 | 
			
		||||
    org.opencontainers.image.licenses="GPL-3.0"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										7
									
								
								server/hooks/build
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								server/hooks/build
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,7 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
docker build \
 | 
			
		||||
	--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
 | 
			
		||||
	--build-arg SOURCE_COMMIT \
 | 
			
		||||
	--build-arg DOCKER_REPO \
 | 
			
		||||
	-f $DOCKERFILE_PATH -t $IMAGE_NAME .
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user