File tree 1 file changed +8
-11
lines changed
1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 4
4
set -ex
5
5
6
6
run () {
7
- local gid=$( id -g) \
8
- group=$( id -g -n) \
9
- target=$1 \
10
- uid=$( id -u) \
11
- user=$( id -u -n)
7
+ local target=$1
12
8
13
9
echo $target
10
+
11
+ # This directory needs to exist before calling docker, otherwise docker will create it but it
12
+ # will be owned by root
13
+ mkdir -p target
14
+
14
15
docker build -t $target ci/docker/$target
15
16
docker run \
16
17
--rm \
18
+ --user $( id -u) :$( id -g) \
17
19
-e CARGO_HOME=/cargo \
18
20
-e CARGO_TARGET_DIR=/target \
19
21
-v $HOME /.cargo:/cargo \
@@ -22,12 +24,7 @@ run() {
22
24
-v ` rustc --print sysroot` :/rust:ro \
23
25
-w /checkout \
24
26
-it $target \
25
- sh -c "
26
- groupadd -g $gid $group
27
- useradd -m -g $gid -u $uid $user
28
- chown $user /cargo /target
29
- su -c 'PATH=\$ PATH:/rust/bin ci/run.sh $target ' $user
30
- "
27
+ sh -c " PATH=\$ PATH:/rust/bin ci/run.sh $target "
31
28
}
32
29
33
30
if [ -z " $1 " ]; then
You can’t perform that action at this time.
0 commit comments