106
106
cat > $dir /Dockerfile << EOF
107
107
FROM nixos/nix
108
108
RUN nix-channel --update
109
- RUN nix-shell -p gnum4 git rsync patch gnutar bzip2 gnumake wget ocamlPackages. ocaml ocamlPackages. ocaml-compiler-libs unzip gcc diffutils patch getconf
109
+ RUN nix-env -i gnum4 git rsync patch bzip2 gnumake wget ocaml ocaml5.1.1- ocaml-compiler-libs unzip gcc diffutils patch getconf-glibc gnused
110
110
EOF
111
111
esac
112
112
@@ -127,38 +127,31 @@ RUN echo 'default-invariant: [ $OCAML_INVARIANT ]' > /opam/opamrc
127
127
RUN /usr/bin/opam init --no-setup --disable-sandboxing --bare --config /opam/opamrc git+$OPAM_REPO #$OPAM_REPO_SHA
128
128
RUN echo 'archive-mirrors: "https://opam.ocaml.org/cache"' >> \$ OPAMROOT/config
129
129
RUN /usr/bin/opam switch create this-opam --formula='$OCAML_INVARIANT '
130
- RUN /usr/bin/opam install opam-core opam-state opam-solver opam-repository opam-format opam-client --deps
131
- RUN /usr/bin/opam clean -as --logs
132
- COPY entrypoint.sh /opam/entrypoint.sh
133
130
EOF
134
131
135
- if [ " $target " != " nix" ]; then
136
- cat >> $dir /Dockerfile << EOF
137
- ENTRYPOINT ["/opam/entrypoint.sh"]
132
+ # we can't `nix-env -i binutils`
133
+ # https://github.com/NixOS/nix/issues/10587
134
+ if [ $target == " nix" ]; then
135
+ cat >> $dir /Dockerfile << EOF
136
+ RUN nix-shell -p binutils --run "/usr/bin/opam install opam-core opam-state opam-solver opam-repository opam-format opam-client --deps"
138
137
EOF
139
138
else
140
- cat >> $dir /Dockerfile << EOF
141
- ENTRYPOINT ["nix-shell", "-p", "gnum4", "git", "rsync", "patch", "gnutar", "bzip2", "gnumake", "wget", "ocamlPackages.ocaml", "ocamlPackages.ocaml-compiler-libs", "unzip", "gcc", "diffutils", "patch", "getconf", "--run", "/opam/entrypoint.sh"]
139
+ cat >> $dir /Dockerfile << EOF
140
+ RUN /usr/bin/opam install opam-core opam-state opam-solver opam-repository opam-format opam-client --deps
142
141
EOF
143
142
fi
144
143
144
+ cat >> $dir /Dockerfile << EOF
145
+ RUN /usr/bin/opam clean -as --logs
146
+ COPY entrypoint.sh /opam/entrypoint.sh
147
+ ENTRYPOINT ["/opam/entrypoint.sh"]
148
+ EOF
149
+
145
150
# ## Generate the entrypoint
146
151
cat > $dir /entrypoint.sh << EOF
147
152
#!/bin/sh
148
153
set -eux
149
154
150
- EOF
151
-
152
- if [ " $target " != " nix" ]; then
153
- cat >> $dir /entrypoint.sh << EOF
154
- export PATH="$PATH :/usr/bin/"
155
- chmod +x /usr/bin/opam
156
-
157
- EOF
158
- fi
159
-
160
- # ## Generate the entrypoint
161
- cat > $dir /entrypoint.sh << EOF
162
155
git config --global --add safe.directory /github/workspace
163
156
164
157
# Workdir is /github/workpaces
0 commit comments