Skip to content

Commit f037534

Browse files
osfameronjeffrymorris
authored andcommitted
Dockerfile to run SDK examples
USAGE: docker-compose run cb-dotnet-sdk bash
1 parent 40481f6 commit f037534

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:6.0
2+
3+
LABEL org.opencontainers.image.authors="Hakim Cassimally <[email protected]>"
4+
5+
RUN apt-get update -y \
6+
&& \
7+
apt-get install -y \
8+
curl vim git
9+
10+
# edit these variables as required
11+
ENV PRE_RELEASE_VERSION 3.2.8-pre
12+
ENV PRE_RELEASE_BUILD r5705
13+
ENV PRE_RELEASE_SOURCE http://sdk.jenkins.couchbase.com/job/dotnet/job/sdk/job/couchbase-net-client-scripted-build-pipeline/lastSuccessfulBuild/artifact/couchbase-net-client-${PRE_RELEASE_VERSION}-${PRE_RELEASE_BUILD}.zip
14+
15+
RUN mkdir -p /app/nuget-sources/
16+
WORKDIR /app/nuget-sources/
17+
RUN curl -O ${PRE_RELEASE_SOURCE}
18+
RUN dotnet nuget add source /app/nuget-sources/
19+
20+
WORKDIR /app
21+
RUN dotnet new console
22+
RUN dotnet add package CouchbaseNetClient -v ${PRE_RELEASE_VERSION}
23+
24+
RUN dotnet tool install -g dotnet-script
25+
RUN export PATH="$PATH:/root/.dotnet/tools"
26+
27+
# RUN git clone https://github.com/couchbase/docs-sdk-dotnet.git
28+
# NB: instead we will mount working directory in docker-compose.yml
29+
30+
ENTRYPOINT ["/bin/bash", "-l", "-c"]
31+
CMD ["/bin/bash"]

docker-compose.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: "3.9"
2+
3+
# USAGE: docker-compose run cb-dotnet-sdk bash
4+
5+
services:
6+
cb-dotnet-sdk:
7+
build: .
8+
depends_on:
9+
- db
10+
container_name: cb-dotnet-sdk
11+
entrypoint: [ "/bin/bash", "-l", "-c" ]
12+
volumes:
13+
- .:/app/docs-sdk-dotnet
14+
15+
db:
16+
image: build-docker.couchbase.com:443/couchbase/server-internal:7.1.0-2549
17+
ports:
18+
- "8091-8095:8091-8095"
19+
- "11210:11210"
20+
expose: # expose ports 8091 & 8094 to other containers (mainly for backend)
21+
- "8091"
22+
- "8092"
23+
- "8093"
24+
- "8094"
25+
- "8095"
26+
- "11210"
27+
container_name: couchbase-db

0 commit comments

Comments
 (0)