X Tutup
Skip to content

Commit 24b331a

Browse files
committed
omit sudo when EUID eqto 0
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com> omit sudo when EUID eqto 0 Signed-off-by: fahedouch <fahed.dorgaa@gmail.com> omit sudo when EUID eqto 0 Signed-off-by: fahedouch <fahed.dorgaa@gmail.com> omit sudo when EUID eqto 0 Signed-off-by: fahedouch <fahed.dorgaa@gmail.com> use gosu to omit sudo in GA Signed-off-by: fahedouch <fahed.dorgaa@gmail.com> use gosu to omit sudo in GA Signed-off-by: fahedouch <fahed.dorgaa@gmail.com> set working-dir for <<Setup gosu>> step Signed-off-by: fahedouch <fahed.dorgaa@gmail.com> fix job permissions Signed-off-by: fahedouch <fahed.dorgaa@gmail.com>
1 parent 7d7104c commit 24b331a

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,16 @@ jobs:
269269
with:
270270
go-version: '1.13.10'
271271

272+
- name: Setup gosu
273+
shell: bash
274+
run: |
275+
GOSU=/usr/local/bin/gosu
276+
arch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"
277+
sudo wget -O ${GOSU} "https://github.com/tianon/gosu/releases/download/1.12/gosu-$arch"
278+
sudo chmod +x ${GOSU}
279+
sudo chown root ${GOSU}
280+
sudo chmod +s ${GOSU}
281+
272282
- name: Set env
273283
shell: bash
274284
run: |
@@ -285,7 +295,7 @@ jobs:
285295
RUNC_FLAVOR: ${{ matrix.runc }}
286296
run: |
287297
sudo PATH=$PATH script/setup/install-seccomp
288-
script/setup/install-runc
298+
gosu root script/setup/install-runc
289299
script/setup/install-cni
290300
script/setup/install-critools
291301
working-directory: src/github.com/containerd/containerd

script/setup/install-runc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ function install_runc() {
2727
cd "$GOPATH"/src/github.com/opencontainers/runc
2828
git checkout $RUNC_COMMIT
2929
make BUILDTAGS='apparmor seccomp selinux' runc
30-
sudo make install
30+
make install
3131
}
3232

3333
function install_crun() {
3434
CRUN_VERSION=0.11
35-
sudo curl -o /usr/local/sbin/runc -L https://github.com/containers/crun/releases/download/${CRUN_VERSION}/crun-${CRUN_VERSION}-static-$(uname -m)
36-
sudo chmod +x /usr/local/sbin/runc
35+
curl -o /usr/local/sbin/runc -L https://github.com/containers/crun/releases/download/${CRUN_VERSION}/crun-${CRUN_VERSION}-static-$(uname -m)
36+
chmod +x /usr/local/sbin/runc
3737
}
3838

3939
: ${RUNC_FLAVOR=runc}
@@ -44,4 +44,4 @@ crun) install_crun ;;
4444
echo >&2 "unknown runc flavor: ${RUNC_FLAVOR}"
4545
exit 1
4646
;;
47-
esac
47+
esac

0 commit comments

Comments
 (0)
X Tutup