File tree Expand file tree Collapse file tree 6 files changed +36
-0
lines changed Expand file tree Collapse file tree 6 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ RUN apt-get update && \
10
10
scipy && \
11
11
rm -rf /var/lib/apt/lists/*
12
12
13
+ COPY ./bin/update/nim /update/
14
+ RUN set -xe && \
15
+ apt-get update && \
16
+ apt-get install -y --no-install-recommends cron && \
17
+ /update/nim && \
18
+ echo "0 0 * * * /update/nim &> /var/log/nim.log" | crontab - && \
19
+ rm -rf /var/lib/apt/lists/*
20
+
13
21
COPY docker-entrypoint.sh /
14
22
ENTRYPOINT ["/docker-entrypoint.sh" ]
15
23
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ nimDir=/usr/local/nim
3
+ nim=$nimDir /bin/nim
4
+
5
+ stable_version=` curl -fSsL https://nim-lang.org/channels/stable`
6
+ [[ -f $nim ]] && current_version=` $nim -v | head -n 1 | awk ' { print $4 }' `
7
+
8
+ echo " Current version: $current_version "
9
+ echo " Latest stable version: $stable_version "
10
+
11
+ if [[ $stable_version != $current_version ]]; then
12
+ echo " Updating Nim to latest stable version."
13
+ curl -fSsL " https://nim-lang.org/download/nim-$stable_version -linux_x64.tar.xz" -o /tmp/nim.tar.xf
14
+ rm -rf $nimDir
15
+ mkdir $nimDir
16
+ tar -xf /tmp/nim.tar.xf -C $nimDir --strip-components=1
17
+ chmod +x $nim
18
+ rm /tmp/nim.tar.xf
19
+ else
20
+ echo " Nim is already up to date."
21
+ fi
Original file line number Diff line number Diff line change
1
+ VERSIONS =" stable"
2
+ NAME =" Nim ($VERSION)"
3
+ SOURCE_FILE =" main.nim"
4
+ BINARY_FILE =" main"
5
+ COMPILE_CMD =" /usr/local/nim/bin/nim compile --nimcache:.cache/nim $ARGS $SOURCE_FILE"
6
+ RUN_CMD =" ./$BINARY_FILE"
Original file line number Diff line number Diff line change
1
+ echo " hello, world"
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments