Skip to content

Commit

Permalink
Dockerfile: operate on root
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Czarnecki <[email protected]>
  • Loading branch information
lpawelcz committed Feb 13, 2024
1 parent ef3630f commit f4c615f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 25 deletions.
33 changes: 27 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
env:
DEBIAN_FRONTEND: "noninteractive"
steps:
- name: pre checkout info
run: |
whoami
pwd
ls -la
- name: Checkout Megaboom
uses: actions/checkout@v4
with:
Expand All @@ -30,11 +35,11 @@ jobs:
with:
repository: antmicro/bazel-orfs
path: bazel-orfs
- name: Checkout bazel-orfs
- name: post checkout info
run: |
cd bazel-orfs
git checkout master
cd ../megaboom
whoami
pwd
ls -la
- name: query target
run: |
bazel query ${{ matrix.TARGET }}
Expand All @@ -59,9 +64,25 @@ jobs:
env:
DEBIAN_FRONTEND: "noninteractive"
steps:
- name: bazel-orfs setup
- name: pre checkout info
run: |
whoami
pwd
ls -la
- name: Checkout Megaboom
uses: actions/checkout@v4
with:
path: megaboom
- name: Clone bazel-orfs
uses: actions/checkout@v4
with:
repository: antmicro/bazel-orfs
path: bazel-orfs
- name: post checkout info
run: |
git clone https://github.com/The-OpenROAD-Project/bazel-orfs.git ../bazel-orfs
whoami
pwd
ls -la
- name: query target
run: |
bazel query ${{ matrix.TARGET }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: docker update

on:
workflow_dispatch:
push:

jobs:
docker:
Expand Down
24 changes: 5 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
# Non-root user setup
ARG USERNAME=tester
ARG TESTER_HOME=/home/$USERNAME
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG USERNAME=root
ARG TESTER_HOME=/root

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $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

# Set the default user to non-root one
USER $USERNAME

RUN sudo apt-get update -y
RUN sudo apt-get upgrade -y
RUN sudo apt-get install -y git vim wget python-is-python3
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install -y sudo git vim wget python-is-python3

# Setup ORFS under ~
WORKDIR $TESTER_HOME
Expand All @@ -36,5 +23,4 @@ RUN source ./env.sh && yosys -help && openroad -help && cd flow && make -j $(npr
RUN sudo wget https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -O /usr/local/bin/bazel
RUN sudo chmod +x /usr/local/bin/bazel

# Setup megaboom
WORKDIR $TESTER_HOME

0 comments on commit f4c615f

Please sign in to comment.