mirror of
https://github.com/mainnika/mongox-go-driver.git
synced 2026-05-22 15:53:36 +00:00
Add dockerfile for testing
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# syntax = docker/dockerfile:1.3-labs
|
||||
FROM registry.access.redhat.com/ubi8/ubi
|
||||
|
||||
RUN <<EOF cat >> /etc/yum.repos.d/mongo.repo
|
||||
[mongodb-org]
|
||||
name=MongoDB Repository
|
||||
baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/4.4/x86_64/
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
|
||||
EOF
|
||||
|
||||
RUN set -eux \
|
||||
&& dnf makecache \
|
||||
&& dnf install -yq mongodb-org-server golang \
|
||||
&& dnf clean all
|
||||
|
||||
WORKDIR /root/mongox
|
||||
|
||||
ENV GOPATH=/root/go
|
||||
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
|
||||
RUN set -eux \
|
||||
&& go mod download
|
||||
|
||||
COPY mongox-testing mongox-testing
|
||||
COPY mongox mongox
|
||||
|
||||
CMD set -eux \
|
||||
&& nohup mongod --dbpath $(mktemp -d) \
|
||||
& go test -timeout 30s -v ./...
|
||||
Reference in New Issue
Block a user