-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.debian
87 lines (73 loc) · 3.69 KB
/
Dockerfile.debian
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM mcr.microsoft.com/dotnet/sdk:6.0.302-bullseye-slim-amd64
ENV PAKET_VERSION=7.1.5 \
FAKE_VERSION=5.22.0 \
NODE_VERSION=16.16.0 \
NPM_VERSION=8.10.0 \
YARN_VERSION=1.22.19
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
sudo git ca-certificates wget apt-utils locales git unzip nano ssh-client xz-utils gnupg2
# intall Nodejs, Npm, Yarn
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
i386) ARCH='x86';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-$ARCH.tar.xz" \
&& tar -xJf "node-v${NODE_VERSION}-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v${NODE_VERSION}-linux-$ARCH.tar.xz" \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
RUN npm install -g yarn@${YARN_VERSION}
################################################################################
# For Dojo
################################################################################
ENV DOJO_VERSION=0.11.0
RUN git clone --depth 1 -b ${DOJO_VERSION} https://github.com/kudulab/dojo.git /tmp/dojo_git &&\
/tmp/dojo_git/image_scripts/src/install.sh && \
rm -r /tmp/dojo_git && \
echo 'dojo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
################################################################################
# Above Dojo
################################################################################
RUN su dojo -c 'dotnet tool install fake-cli -g --version ${FAKE_VERSION}'
RUN su dojo -c 'dotnet tool install Paket -g --version ${PAKET_VERSION} --add-source https://api.nuget.org/v3/index.json'
# Install common usage apt packages.
# * ssh-client - to run git clone over ssh
# * locale-gen en_US.UTF-8 - so that perl does not complain like: "perl: warning: Setting locale failed."
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF &&\
locale-gen en_US.UTF-8 && localedef -i en_US -f UTF-8 en_US.UTF-8 && update-locale
RUN mkdir -p /home/dojo/.config/NuGet/ /home/dojo/.nuget/NuGet
COPY NuGet.Config /home/dojo/.nuget/NuGet/NuGet.Config
RUN ln -s /home/dojo/.nuget/NuGet/NuGet.Config /home/dojo/.config/NuGet/NuGet.Config &&\
chown dojo:dojo -R /home/dojo/.nuget
COPY core/* /usr/bin/
# Install bats
ENV BATS_CORE_VERSION=1.2.1 BATS_SUPPORT_VERSION=004e707638eedd62e0481e8cdc9223ad471f12ee BATS_ASSERT_VERSION=9f88b4207da750093baabc4e3f41bf68f0dd3630
RUN cd /tmp &&\
git clone --depth 1 -b v${BATS_CORE_VERSION} https://github.com/bats-core/bats-core.git &&\
cd bats-core && ./install.sh /opt &&\
cd .. && rm -r bats-core &&\
ln -s /opt/bin/bats /usr/bin/bats &&\
git clone https://github.com/ztombol/bats-support.git /opt/bats-support &&\
cd /opt/bats-support && git reset --hard ${BATS_SUPPORT_VERSION} &&\
git clone https://github.com/ztombol/bats-assert.git /opt/bats-assert &&\
cd /opt/bats-assert && git reset --hard ${BATS_ASSERT_VERSION}
# Warm up image
RUN su dojo -c 'mkdir -p /tmp/warmup && cd /tmp/warmup && dotnet new classlib && dotnet restore && dotnet build && rm -rf /tmp/warmup' &&\
rm -rf /tmp/NuGetScratch
# Disable microsoft spying
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
# For Bash
COPY profile /home/dojo/.profile
COPY bashrc_default /home/dojo/.bashrc
RUN chown dojo:dojo -R /home/dojo
# Those are light to install and may change often, so they go at the bottom
# of this Dockerfile.
COPY etc_dojo.d/scripts/* /etc/dojo.d/scripts/
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
CMD ["/bin/bash"]