-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (36 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# stage 0: compile go program
FROM golang:1.20-bullseye
RUN mkdir -p /tmp/data-stager
WORKDIR /tmp/data-stager
ADD internal ./internal
ADD pkg ./pkg
ADD go.mod .
ADD go.sum .
ADD Makefile .
RUN GOOS=linux make
# stage 1: build image for the required packages
FROM almalinux:8 as base
RUN yum install -y nfs4-acl-tools sssd-client attr acl && yum clean all && rm -rf /var/cache/yum/*
# clean up temporary files created by yum install
RUN ( yum clean all && \
rm -rf /var/cache/yum/* && \
rm -rf /tmp/* )
# create work directory
RUN ( mkdir -p /opt/stager )
# create configuration directory
RUN ( mkdir -p /etc/stager/ssl )
# expected data sources
VOLUME ["/project", "/project_freenas", "/project_cephfs", "/home"]
# stage 2: build image for api-server
FROM base as api-server
WORKDIR /opt/stager
EXPOSE 8080
COPY --from=0 /tmp/data-stager/build/data-stager-api .
ENTRYPOINT ["./data-stager-api"]
# stage 3: build image for the worker
FROM base as worker
WORKDIR /opt/stager
RUN ( mkdir -p /opt/irods/ssl )
COPY --from=0 /tmp/data-stager/build/data-stager-worker .
COPY --from=0 /tmp/data-stager/build/s-isync .
ENTRYPOINT ["./data-stager-worker"]