Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parking-sensors): changed from root to non-root devcontainer #647

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#-----------------------------------------------------------------------------------------
FROM python:3.7

ARG USERNAME=mdwuser
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Configure apt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
Expand All @@ -16,27 +20,40 @@ RUN apt-get -y install git procps lsb-release
RUN apt-get install -y libicu[0-9][0-9]

# Install java
RUN apt-get install -y openjdk-11-jdk
ENV JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
RUN echo "deb https://packages.adoptium.net/artifactory/deb \
$(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" \
| tee /etc/apt/sources.list.d/adoptium.list
RUN apt-get update \
&& apt-get -y install --no-install-recommends \
temurin-11-jdk


RUN mkdir /workspace
WORKDIR /workspace
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME

RUN mkdir /home/$USERNAME/workspace
WORKDIR /home/$USERNAME/workspace

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Install Python dependencies from requirements.txt and requirements_dev.txt
COPY requirements.txt* requirements_dev.txt* /workspace/
COPY requirements.txt* requirements_dev.txt* /home/$USERNAME/workspace/
RUN chown -R $USERNAME:$USER_GID /home/$USERNAME/workspace
USER $USERNAME
RUN pip install -r requirements_dev.txt \
&& rm requirements_dev.txt* \
&& pip install -r requirements.txt \
&& rm requirements.txt*
ENV PYTHONPATH=/workspace

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog

# Set PACKAGE_VERSION to localdev
ENV PACKAGE_VERSION=localdev

# Set the default shell to bash rather than sh
ENV SHELL /bin/bash
ENV SHELL /bin/bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#-----------------------------------------------------------------------------------------
FROM python:3.7

ARG USERNAME=mdwuser
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Configure apt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
Expand All @@ -16,27 +20,40 @@ RUN apt-get -y install git procps lsb-release
RUN apt-get install -y libicu[0-9][0-9]

# Install java
RUN apt-get install -y openjdk-11-jdk
ENV JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
RUN echo "deb https://packages.adoptium.net/artifactory/deb \
$(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" \
| tee /etc/apt/sources.list.d/adoptium.list
RUN apt-get update \
&& apt-get -y install --no-install-recommends \
temurin-11-jdk


RUN mkdir /workspace
WORKDIR /workspace
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME

RUN mkdir /home/$USERNAME/workspace
WORKDIR /home/$USERNAME/workspace

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Install Python dependencies from requirements.txt and requirements_dev.txt
COPY requirements.txt* requirements_dev.txt* /workspace/
COPY requirements.txt* requirements_dev.txt* /home/$USERNAME/workspace/
RUN chown -R $USERNAME:$USER_GID /home/$USERNAME/workspace
USER $USERNAME
RUN pip install -r requirements_dev.txt \
&& rm requirements_dev.txt* \
&& pip install -r requirements.txt \
&& rm requirements.txt*
ENV PYTHONPATH=/workspace

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog

# Set PACKAGE_VERSION to localdev
ENV PACKAGE_VERSION=localdev

# Set the default shell to bash rather than sh
ENV SHELL /bin/bash
ENV SHELL /bin/bash