Skip to content

Dockerfile: add tsffs-dev target #169

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
15 changes: 15 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"build": { "dockerfile": "Dockerfile", "target": "tsffs-dev" },
"remoteUser": "1003",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace/tsffs,type=bind",
"workspaceFolder": "/workspace/tsffs",
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"ms-azuretools.vscode-containers"
]
}
}
}
29 changes: 28 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# hadolint global ignore=DL3041,DL3040

FROM fedora:38@sha256:b9ff6f23cceb5bde20bb1f79b492b98d71ef7a7ae518ca1b15b26661a11e6a94
FROM fedora:38@sha256:b9ff6f23cceb5bde20bb1f79b492b98d71ef7a7ae518ca1b15b26661a11e6a94 AS tsffs-base

# Download links can be obtained from:
# https://lemcenter.intel.com/productDownload/?Product=256660e5-a404-4390-b436-f64324d94959
Expand Down Expand Up @@ -123,3 +123,30 @@ RUN ispm projects /workspace/projects/example/ --create \
ninja

RUN echo 'echo "To run the demo, run ./simics -no-gui --no-win fuzz.simics"' >> /root/.bashrc

FROM tsffs-base AS tsffs-dev
# build:
# docker build -t tsffs:dev --target tsffs-dev .
# run:
# docker run --rm -ti -u $(id -u) -v .:/workspace/tsffs tsffs:dev

RUN <<EOF
set -e
echo "%wheel ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/sudogrp
# create group for developers
groupadd dev
# set /workspace/simics permissions to root:dev
chown -R root:dev /workspace/{simics,projects} && chmod -R g+w /workspace/{simics,projects}
# create first 5 users
for i in $(seq 5); do
useradd --create-home "docker${i}" --groups dev,wheel
# install Rust nightly
sudo -E -u "docker${i}" bash -c 'curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain none'
# copy Simics ISPM config
mkdir -p /home/docker${i}/.config
cp -r "/root/.config/Intel Simics Package Manager/" "/home/docker${i}/.config/"
chown -R "docker${i}:dev" "/home/docker${i}/.config/"
done
EOF

WORKDIR /workspace/tsffs
Loading