Skip to content
Snippets Groups Projects
Commit 884dba79 authored by Jakub Pelka's avatar Jakub Pelka :cat2:
Browse files

Add npuser, enable pw-less sudo, add git global safe dir

parent 7ab50284
No related branches found
No related tags found
1 merge request!2XX-4183/rootless CI
......@@ -9,6 +9,10 @@ imagebuild:
- cd cuda-go
- chmod +x build-all-images.sh
- ./build-all-images.sh
- cd ..
- cd wasm-go
- chmod +x build-image.sh
- ./build-image.sh
variables:
#DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: "/certs"
......
......@@ -8,7 +8,7 @@ ENV CUDA_VER=1.11.1
#RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata wget git libgmp-dev bc curl nsight-systems-2020.3.4 jq clang build-essential valgrind unzip zip
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata wget git libgmp-dev bc curl nsight-systems-2020.3.4 jq clang build-essential valgrind unzip zip sudo
RUN apt upgrade -y
RUN apt install -y software-properties-common
RUN wget https://go.dev/dl/go1.17.13.linux-amd64.tar.gz
......@@ -40,3 +40,12 @@ COPY upload-artifact-nohash.sh /upload-artifact-nohash.sh
RUN chmod +x /upload-artifact-nohash.sh
COPY hash-file.sh /hash-file.sh
RUN chmod +x /hash-file.sh
RUN git config --global --add safe.directory '*'
RUN useradd --system --create-home --shell /bin/bash npuser
RUN adduser npuser sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER npuser
RUN git config --global --add safe.directory '*'
......@@ -5,13 +5,14 @@ ARG GO_VER
ENV GO_VER=$GO_VER
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata git libgmp-dev bc curl wget jq
RUN apt upgrade -y
RUN apt install -y software-properties-common
RUN add-apt-repository -y ppa:longsleep/golang-backports
RUN apt install -y golang-$GO_VER git libgmp-dev bc curl wget jq
RUN ln -s /usr/lib/go-$GO_VER/bin/go /usr/bin/go
RUN ln -s /usr/lib/go-$GO_VER/bin/gofmt /usr/bin/gofmt
RUN wget https://go.dev/dl/go1.17.13.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.17.13.linux-amd64.tar.gz
RUN ln -s /usr/local/go/bin/go /usr/bin/go
RUN ln -s /usr/local/go/bin/gofmt /usr/bin/gofmt
RUN go version
RUN go install github.com/haya14busa/goverage@latest
......@@ -37,3 +38,12 @@ COPY upload-artifact-nohash.sh /upload-artifact-nohash.sh
RUN chmod +x /upload-artifact-nohash.sh
COPY hash-file.sh /hash-file.sh
RUN chmod +x /hash-file.sh
RUN git config --global --add safe.directory '*'
RUN useradd --system --create-home --shell /bin/bash npuser
RUN adduser npuser sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER npuser
RUN git config --global --add safe.directory '*'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment