You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			42 lines
		
	
	
		
			737 B
		
	
	
	
		
			Docker
		
	
			
		
		
	
	
			42 lines
		
	
	
		
			737 B
		
	
	
	
		
			Docker
		
	
ARG BASE_IMAGE=golang:1.22
 | 
						|
# Ubuntu Nobel Numbat
 | 
						|
ARG BASE_RUNTIME_IMAGE=ubuntu:24.04 
 | 
						|
ARG BASE_UID=1001
 | 
						|
ARG BASE_GID=1001
 | 
						|
FROM ${BASE_IMAGE} AS build-stage
 | 
						|
 | 
						|
WORKDIR /build
 | 
						|
 | 
						|
# Download Go modules
 | 
						|
COPY go.mod ./
 | 
						|
RUN go mod download
 | 
						|
 | 
						|
COPY *.go ./
 | 
						|
 | 
						|
RUN CGO_ENABLED=0 GOOS=linux go build -o fluxfeed
 | 
						|
 | 
						|
FROM ${BASE_RUNTIME_IMAGE} AS runtime-stage
 | 
						|
 | 
						|
ARG BASE_UID=1001
 | 
						|
ARG BASE_GID=1001
 | 
						|
 | 
						|
ENV WORK_DIR=/app
 | 
						|
 | 
						|
RUN groupadd -g ${BASE_GID} flux
 | 
						|
RUN useradd --create-home flux -u ${BASE_UID} -g ${BASE_GID}
 | 
						|
 | 
						|
WORKDIR ${WORK_DIR}
 | 
						|
 | 
						|
COPY --chown=app --from=build-stage /build/fluxfeed ${WORK_DIR}/ 
 | 
						|
 | 
						|
ARG REPO_NAME
 | 
						|
ARG REPO_SHA
 | 
						|
 | 
						|
LABEL io.runcible.repo-name="${REPO_NAME}" \
 | 
						|
      io.runcible.repo-sha="${REPO_SHA}"
 | 
						|
 | 
						|
EXPOSE 8080
 | 
						|
 | 
						|
USER flux
 | 
						|
 | 
						|
CMD ["./fluxfeed"] |