Change Docker user parameters
This commit is contained in:
parent
05ff1742cc
commit
6d8005f7a3
1 changed files with 9 additions and 6 deletions
|
|
@ -1,15 +1,13 @@
|
|||
ARG PYTHON_VERSION=3.12.0
|
||||
ARG PYTHON_VERSION_SHORT=3.12
|
||||
|
||||
FROM ubuntu:22.04 AS python_build
|
||||
FROM ubuntu:22.04 AS python
|
||||
|
||||
ARG PYTHON_VERSION
|
||||
ARG PYTHON_VERSION_SHORT
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
ca-certificates \
|
||||
|
|
@ -71,7 +69,8 @@ RUN apt-get update -y \
|
|||
tklib \
|
||||
vim
|
||||
|
||||
RUN adduser --home /home/runner --shell /bin/bash --disabled-password runner \
|
||||
RUN groupadd --gid 1000 runner \
|
||||
&& adduser --home /workspace --shell /bin/sh --uid 1000 --gid 1000 --disabled-password runner \
|
||||
&& adduser runner sudo \
|
||||
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
|
||||
|
|
@ -102,7 +101,7 @@ RUN set -x \
|
|||
&& npm install --global yarn \
|
||||
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash
|
||||
|
||||
COPY --from=python_build /root/build /tmp/build
|
||||
COPY --from=python /root/build /tmp/build
|
||||
RUN set -x \
|
||||
&& cd /tmp/build/Python-${PYTHON_VERSION} \
|
||||
&& make install \
|
||||
|
|
@ -123,5 +122,9 @@ RUN curl -sSL -O https://packages.microsoft.com/config/ubuntu/22.04/packages-mic
|
|||
&& apt-get update -y \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y azcopy
|
||||
|
||||
RUN mkdir -p /opt/hostedtoolcache \
|
||||
&& chown runner:runner /opt/hostedtoolcache \
|
||||
&& chmod 0755 /opt/hostedtoolcache
|
||||
|
||||
USER runner
|
||||
WORKDIR /home/runner
|
||||
WORKDIR /workspace
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue