diff --git a/Dockerfile b/Dockerfile index 611d13b..49ccfd5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -132,9 +132,6 @@ COPY --from=xschem ${TOOLS}/ ${TOOLS}/ # COPY --from=xyce-xdm ${TOOLS}/ ${TOOLS}/ COPY --from=klayout ${TOOLS}/ ${TOOLS}/ -COPY tools/tools.bashrc /foss/tools/tools.bashrc -RUN echo 'source /foss/tools/tools.bashrc' >> ~/.bashrc - # Allow scripts to be executed by any user # RUN find $STARTUPDIR/scripts -name '*.sh' -exec chmod a+x {} + @@ -149,3 +146,21 @@ RUN echo 'source /foss/tools/tools.bashrc' >> ~/.bashrc # USER 1000:1000 # ENTRYPOINT ["/dockerstartup/scripts/ui_startup.sh"] # CMD ["--wait"] + +# Add the non-root +ARG USERNAME="vscode" +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m -s /bin/bash $USERNAME \ + && apt-get update \ + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME + +USER $USERNAME + +# Prepare bashrc +COPY tools/tools.bashrc /foss/tools/tools.bashrc +RUN echo 'source /foss/tools/tools.bashrc' >> ~/.bashrc \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 162bc42..d752dda 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -11,14 +11,14 @@ tasks: cmds: - docker build --pull --rm -f "Dockerfile" -t ghcr.io/cascode-labs/viper-osic-docker-analog/osic-docker-analog:latest - -t ghcr.io/cascode-labs/viper-osic-docker-analog/osic-docker-analog:v0.2 + -t ghcr.io/cascode-labs/viper-osic-docker-analog/osic-docker-analog:v0.3 "." push: desc: Push the image to GitHub container registry deps: [build] cmds: - docker push ghcr.io/cascode-labs/viper-osic-docker-analog/osic-docker-analog:latest - - docker push ghcr.io/cascode-labs/viper-osic-docker-analog/osic-docker-analog:v0.2 + - docker push ghcr.io/cascode-labs/viper-osic-docker-analog/osic-docker-analog:v0.3 run: desc: Run the doker image diff --git a/tools/klayout/install_base b/tools/klayout/install_base index 911b1c2..bd5d166 100644 --- a/tools/klayout/install_base +++ b/tools/klayout/install_base @@ -2,7 +2,7 @@ set -e echo "[INFO] Adding Klayout APT Packages" -apt-get -y install \ +apt-get -y install --fix-missing \ gcc \ g++ \ make \ @@ -18,3 +18,5 @@ apt-get -y install \ python3-dev \ libz-dev \ libgit2-dev + +strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5