-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.dev
60 lines (43 loc) · 1.65 KB
/
Dockerfile.dev
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM ghcr.io/wtsi-npg/ub-18.04-baton-irods-4.2.11:latest
ARG GO_VERSION=1.22.4
USER root
RUN apt-get update && \
apt-get install -q -y --no-install-recommends \
apt-transport-https \
apt-utils \
build-essential \
ca-certificates \
curl \
gcc \
git \
make
# Install the iRODS icommands package because it's useful for interactions with \
# the server during development
RUN echo "deb [arch=amd64] https://packages.irods.org/apt/ $(lsb_release -sc) main" |\
tee /etc/apt/sources.list.d/renci-irods.list && \
apt-get update && \
apt-get install -q -y --no-install-recommends \
irods-icommands="4.2.11-1~$(lsb_release -sc)"
# For development we want to be able to compile and run tests in the presence of iRODS
# clients, it's more practical to use an iRODS client image and install recent Go than
# to build from a recent Go image and install iRODS clients.
#
# For production we can use a standard Go image as a build stage and copy the compiled
# binary into an iRODS client image.
RUN curl -sSL -O "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz"
RUN tar -C /usr/local -xzf "go${GO_VERSION}.linux-amd64.tar.gz" && \
rm "go${GO_VERSION}.linux-amd64.tar.gz"
ENV GOPATH="/home/appuser/go"
ENV PATH="$GOPATH/bin:/usr/local/go/bin:$PATH"
RUN mkdir -p "$GOPATH"
WORKDIR /app
COPY go.mod go.sum /app/
RUN go mod download && go mod verify
COPY . /app
RUN go install github.com/onsi/ginkgo/v2/ginkgo && \
go get github.com/onsi/gomega/... && \
ginkgo version
RUN chown -R appuser:appuser /app /home/appuser
USER appuser
ENTRYPOINT ["/app/scripts/docker-entrypoint.sh"]
CMD ["/bin/bash", "-c", "sleep infinity"]