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

test: Modified Dockerfile to be able to easily build and test. #623

Merged
merged 1 commit into from
Jul 21, 2022
Merged
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
32 changes: 18 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ FROM ubuntu:16.04

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
curl \
ca-certificates \
dirmngr \
gnupg \
libc6 \
libcurl3 \
libgcc1 \
Expand All @@ -12,27 +17,26 @@ RUN apt-get update \
libstdc++6 \
libunwind8 \
libuuid1 \
make \
software-properties-common \
wget \
zlib1g \
curl \
ca-certificates \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& apt-add-repository 'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' \
&& wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install -y \
dotnet-sdk-3.1 \
dotnet-sdk-6.0 \
mono-complete \
&& rm -rf /var/lib/apt/lists/*

ENV DOTNET_SDK_VERSION 2.1.4
ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz
ENV DOTNET_SDK_DOWNLOAD_SHA 05FE90457A8B77AD5A5EB2F22348F53E962012A55077AC4AD144B279F6CAD69740E57F165820BFD6104E88B30E93684BDE3E858F781541D4F110F28CD52CE2B7

RUN curl -SL $DOTNET_SDK_DOWNLOAD_URL --output dotnet.tar.gz \
&& echo "$DOTNET_SDK_DOWNLOAD_SHA dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
&& rm dotnet.tar.gz

RUN mkdir /twilio
WORKDIR /twilio

COPY src ./src
COPY test ./test
COPY Twilio.sln .
COPY Makefile .

RUN dotnet restore
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,25 @@ To use a custom HTTP client with this helper library, please see the [Twilio doc

## Docker Image

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

You could use the docker image for building and running tests:
```bash
docker build -t twiliobuild .
```

Bash:
```bash
docker run -it --rm -v $(pwd):/twilio twiliobuild
make test
```

Powershell:
```pwsh
docker run -it --rm -v ${PWD}:/twilio twiliobuild
make test
```


## Getting help

Expand Down