mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-31 02:37:05 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
| # Defining custom repo urls for use in enterprise environments. Re-used between stages below.
 | |
| ARG ALPINE_REPO_URL=http://dl-cdn.alpinelinux.org/alpine
 | |
| 
 | |
| FROM golang:1-alpine3.18 AS binary
 | |
| 
 | |
| ARG ALPINE_REPO_URL
 | |
| 
 | |
| ENV DOCKERIZE_VERSION v0.6.1
 | |
| WORKDIR /go/src/github.com/jwilder
 | |
| 
 | |
| # Optionally set corporate mirror for apk
 | |
| RUN if [ "${ALPINE_REPO_URL}" != "http://dl-cdn.alpinelinux.org/alpine" ] ; then sed -i "s#http.*://dl-cdn.alpinelinux.org/alpine#${ALPINE_REPO_URL}#g" /etc/apk/repositories ; fi
 | |
| 
 | |
| RUN apk --no-cache --update add openssl git tar curl
 | |
| 
 | |
| WORKDIR /go/src/github.com/jwilder/dockerize
 | |
| 
 | |
| RUN go install github.com/jwilder/dockerize@$DOCKERIZE_VERSION
 | |
| 
 | |
| FROM alpine:3.18
 | |
| COPY --from=binary /go/bin/dockerize /usr/local/bin
 | |
| 
 | |
| ARG ALPINE_REPO_URL
 | |
| 
 | |
| # Optionally set corporate mirror for apk
 | |
| RUN if [ "${ALPINE_REPO_URL}" != "http://dl-cdn.alpinelinux.org/alpine" ] ; then sed -i "s#http.*://dl-cdn.alpinelinux.org/alpine#${ALPINE_REPO_URL}#g" /etc/apk/repositories ; fi
 | |
| 
 | |
| # PFP-260: Upgrade Sqlite to >=3.28.0-r0 to fix https://security.snyk.io/vuln/SNYK-ALPINE39-SQLITE-449762
 | |
| RUN apk add --no-cache mysql-client bash mariadb-connector-c sqlite
 | |
| 
 | |
| COPY docker/mysql-setup/init.sql /init.sql
 | |
| COPY docker/mysql-setup/init.sh /init.sh
 | |
| RUN chmod 755 init.sh
 | |
| 
 | |
| ENV DATAHUB_DB_NAME="datahub"
 | |
| 
 | |
| CMD dockerize -wait tcp://$MYSQL_HOST:$MYSQL_PORT -timeout 240s /init.sh
 | |
| 
 | 
