-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdockerfile
62 lines (53 loc) · 2.3 KB
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
FROM ubuntu:latest
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# To ensure filesystem encoding is proper, add these.
# See: https://github.com/pypa/pip/issues/10219#issuecomment-887337037
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# To make it easier for build and release pipelines to run apt-get,
# configure apt to not require confirmation (assume the -y argument by default)
ENV DEBIAN_FRONTEND noninteractive
RUN echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-utils \
software-properties-common \
build-essential \
jq \
git \
python3 \
python3-dev \
python3-pip && \
rm -rf /var/lib/apt/lists/*
RUN add-apt-repository universe \
&& add-apt-repository multiverse \
&& apt update
RUN pip3 install --upgrade \
setuptools \
pip
ADD requirements.txt /requirements.txt
RUN pip3 install --upgrade -r /requirements.txt
RUN ln -s /usr/bin/python3 /usr/bin/python \
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
&& groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
# [Optional] Add sudo support for the non-root user
&& apt-get install sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
&& chmod 0440 /etc/sudoers.d/$USERNAME \
#
# Clean up
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN ansible-galaxy collection install chocolatey.chocolatey --upgrade