Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Added a Dockerfile to be able to easily build and test. #615

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Dockerbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:20.04 as build

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libssl1.1 \
ca-certificates \
wget \
dirmngr \
gnupg \
apt-transport-https \
software-properties-common \
make \
&& rm -rf /var/lib/apt/lists/*

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN apt-add-repository 'deb https://download.mono-project.com/repo/ubuntu stable-focal main'
RUN apt -y install mono-complete

RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb

RUN apt-get update; apt-get update && apt-get install -y dotnet-sdk-3.1 && apt-get install -y dotnet-sdk-6.0

WORKDIR /twilio
38 changes: 38 additions & 0 deletions Dockerbuild/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Building Twilio project through Docker

## Build your image

In the root of the repository:

Powershell/cmd:
```pwsh
docker build -t twiliobuild .\Dockerbuild\
```
bash:
```bash
docker build -t twiliobuild ./Dockerbuild/
```

## Restore/Compile/Test

In the repository root:

### Start the container:

powershell:
```pwsh
docker run -it --rm -v ${PWD}:/twilio twiliobuild
```
bash:
```bash
docker run -it --rm -v $(pwd):/twilio twiliobuild
```

### Test
In the shell:

1) `dotnet restore`
2) `dotnet build -c Release --no-restore`
3) `dotnet test -c Release --no-build`

Or just in one command `make test`
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ To use a custom HTTP client with this helper library, please see the [Twilio doc

The `Dockerfile` present in this repository and its respective `twilio/twilio-csharp` Docker image are currently used by Twilio for testing purposes only.

## Docker build Image

There is a [Dockerfile](Dockerbuild/) available for build/testing your code.


## Getting help

If you need help installing or using the library, please check the [Twilio Support Help Center](https://support.twilio.com) first, and [file a support ticket](https://twilio.com/help/contact) if you don't find an answer to your question.
Expand Down