Docker Quickstart Setup
?
1️⃣ Dockerfile (tools/docker/Dockerfile)
# Base image
FROM ubuntu:22.04
# Arguments
ARG DEBIAN_FRONTEND=noninteractive
ARG USERNAME=workshop
ARG USER_UID=1000
ARG USER_GID=1000
ENV PATH="/opt/riscv/bin:${PATH}"
WORKDIR /home/${USERNAME}/work
# Install essential packages
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential git make cmake wget curl \
python3 python3-pip unzip bison flex \
autoconf automake libtool gawk pkg-config \
gdb-multiarch spike sudo vim less locales \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN groupadd -g ${USER_GID} ${USERNAME} \
&& useradd -m -u ${USER_UID} -g ${USER_GID} -s /bin/bash ${USERNAME} \
&& echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \
&& chmod 0440 /etc/sudoers.d/${USERNAME}
USER ${USERNAME}
# Copy Quickstart script
COPY docker-quickstart.sh /usr/local/bin/docker-quickstart.sh
RUN chmod +x /usr/local/bin/docker-quickstart.sh
# Default command
ENTRYPOINT [ "/usr/local/bin/docker-quickstart.sh" ]
CMD [ "bash" ]
2️⃣ Docker Quickstart Script (tools/docker/docker-quickstart.sh)
#!/usr/bin/env bash
set -euo pipefail
echo "=== Docker Quickstart: Setting up RISC-V Workshop ==="
# Install RISC-V toolchain if not present
if ! command -v riscv64-unknown-elf-gcc &>/dev/null; then
echo "Installing RISC-V GNU Toolchain..."
TMPDIR=$(mktemp -d)
git clone --depth 1 https://github.com/riscv-collab/riscv-gnu-toolchain.git "$TMPDIR/riscv-gnu-toolchain"
cd "$TMPDIR/riscv-gnu-toolchain"
./configure --prefix=/opt/riscv --with-arch=rv64gc --with-abi=lp64d
make -j"$(nproc)"
cd -
rm -rf "$TMPDIR"
else
echo "RISC-V toolchain already installed."
fi
# Create workshop directories
WORK_DIR="$HOME/riscv-workshop"
mkdir -p "$WORK_DIR/examples"
mkdir -p "$WORK_DIR/exercises/day01-environment"
mkdir -p "$WORK_DIR/exercises/day02-sim-and-toolchain"
# Add starter example
cat > "$WORK_DIR/examples/hello.c" <<'EOF'
#include <stdio.h>
int main() {
printf("Hello, RISC-V Workshop (Docker)!\n");
return 0;
}
EOF
# Build and run example
mkdir -p "$WORK_DIR/build"
riscv64-unknown-elf-gcc -O2 -march=rv64gc -mabi=lp64d -o "$WORK_DIR/build/hello.elf" "$WORK_DIR/examples/hello.c"
echo "Running example on Spike simulator:"
spike "$WORK_DIR/build/hello.elf"
echo "=== Quickstart Complete! ==="
echo "Workshop ready in $WORK_DIR"
echo "You can now explore exercises under $WORK_DIR/exercises/"
exec bash
3️⃣ How to Build and Run
-
Build Docker image
docker build -t riscv-workshop:quickstart -f tools/docker/Dockerfile .
-
Run the container interactively
docker run --rm -it -v "$PWD:/work" riscv-workshop:quickstart
-
The script will automatically:
-
Install the RISC-V toolchain (if missing)
-
Create
riscv-workshopfolder inside the container -
Add
hello.cexample -
Compile and run it on Spike simulator
-
Start an interactive Bash shell inside the container
-
✅ Benefits
-
One command setup: Participants don’t touch system dependencies
-
Reproducible environment: Everyone uses the same container
-
Ready to start exercises immediately
If you want, I can also create a combined Quickstart:
Participants can run exactly one command on their host, and it will either use Docker or Ubuntu automatically depending on what’s available.
Do you want me to make that next?
入金伝票
最近10件の入金伝票
name1 =
userID=
agent =
cnset =
cash =
date =
i=1
id=259
| 会員 | 所属 | 金額 | テスト番号 | testID | MHC_id | 日付 | 11 | 0 | 150000 | 4 | 4007 | 57 | 2020-08-11 | 10 | 0 | 50000 | 4 | 4006 | 56 | 2020-08-10 | 9 | 6 | 149999 | 4 | 4005 | 35 | 0000-00-00 | 12 | 0 | 50000 | 3 | 3002 | 26 | 2020-08-12 | 7 | 6 | 50000 | 2 | 2003 | 25 | 2020-08-12 | 3 | 0 | 50000 | 1 | 1008 | 2 | 2020-08-10 | 2 | 0 | 50000 | 1 | 1007 | 1 | 2020-08-10 | 2 | 0 | 50000 | 1 | 1006 | 1 | 2020-08-17 | 11 | 0 | 50000 | 1 | 1005 | 67 | 2020-08-25 | 11 | 0 | 50000 | 1 | 1004 | 66 | 2020-08-09 |
|---|