This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
forked from Azure/autorest.csharp
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
70 lines (54 loc) · 2.23 KB
/
Dockerfile
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
61
62
63
64
65
66
67
68
69
70
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
ENV HTTP_PROXY=http://hk-agcprx-2000.corpdmz.agoda.local:8080 \
HTTPS_PROXY=http://hk-agcprx-2000.corpdmz.agoda.local:8080 \
NO_PROXY="localhost,127.0.0.0/8,10.0.0.0/8,169.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.local,*.agodadev.io, smapi_mock, kafka" \
http_proxy=http://hk-agcprx-2000.corpdmz.agoda.local:8080 \
https_proxy=http://hk-agcprx-2000.corpdmz.agoda.local:8080 \
no_proxy="localhost,127.0.0.0/8,10.0.0.0/8,169.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.local,*.agodadev.io, smapi_mock, kafka"
RUN apt-get update && apt-get install -y curl libunwind8 libunwind-dev
# Set debconf to run non-interactively
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Install base dependencies
RUN apt-get update && apt-get install -y -q --no-install-recommends \
apt-transport-https \
build-essential \
ca-certificates \
curl \
git \
libssl-dev \
wget \
&& rm -rf /var/lib/apt/lists/*
ENV NVM_DIR /root/.nvm
ENV NODE_VERSION 16.19.1
# # Install nvm with node and npm
RUN curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default \
&& nvm \
&& node -v \
ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN npm config set strict-ssl false
RUN node -v
RUN npm install npm -g
RUN npm install -g autorest@latest
RUN npm i -g eol-converter-cli
COPY package.json /tmp/package.json
RUN cd /tmp && npm install
RUN mkdir -p /app && cp -a /tmp/node_modules /app/
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
WORKDIR /app
COPY ./src/*.csproj ./
COPY . ./
RUN dotnet sln remove "agoda.csharp.client.test/agoda.csharp.client.test.csproj"
RUN dotnet restore
RUN dotnet build
COPY README.md /app/README.md
RUN mkdir -p /output
CMD ["/app/build/create-project.sh"]