0.1 commit
This commit is contained in:
parent
ba81b11579
commit
ab9607b7f1
8 changed files with 655 additions and 44 deletions
51
micro-fedora43-dev/Dockerfile
Normal file
51
micro-fedora43-dev/Dockerfile
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
FROM fedora:43
|
||||
|
||||
# Basic tools + SSH + dev stack (+ fastfetch if available)
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
openssh-server \
|
||||
sudo \
|
||||
ca-certificates \
|
||||
git \
|
||||
curl wget \
|
||||
vim nano \
|
||||
htop \
|
||||
gcc gcc-c++ make \
|
||||
fastfetch || true && \
|
||||
dnf clean all && \
|
||||
rm -rf /var/cache/dnf
|
||||
|
||||
# Create 'micro' user with fixed uid/gid 1000
|
||||
RUN useradd -m -u 1000 -U -s /bin/bash micro && \
|
||||
echo "micro:ChangeMe123" | chpasswd && \
|
||||
usermod -aG wheel micro
|
||||
|
||||
# Prepare .ssh directory
|
||||
RUN mkdir -p /home/micro/.ssh && \
|
||||
chown -R micro:micro /home/micro && \
|
||||
chmod 700 /home/micro/.ssh
|
||||
|
||||
# SSH server config: key-only login, use ~/.ssh/authorized_keys
|
||||
RUN sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config || true && \
|
||||
sed -i 's/^PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config || true && \
|
||||
sed -i 's/^#KbdInteractiveAuthentication yes/KbdInteractiveAuthentication no/' /etc/ssh/sshd_config || true && \
|
||||
sed -i 's/^#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config || true && \
|
||||
sed -i 's|^#AuthorizedKeysFile.*|AuthorizedKeysFile .ssh/authorized_keys|' /etc/ssh/sshd_config || true && \
|
||||
echo 'UsePAM no' >> /etc/ssh/sshd_config
|
||||
|
||||
# Generate host keys and make sure run dir exists
|
||||
RUN mkdir -p /var/run/sshd && \
|
||||
ssh-keygen -A
|
||||
|
||||
# Fastfetch config for micro (reuse your existing JSON)
|
||||
RUN mkdir -p /home/micro/.config/fastfetch
|
||||
COPY fastfetch_config.json /home/micro/.config/fastfetch/config.jsonc
|
||||
RUN chown -R micro:micro /home/micro/.config && \
|
||||
echo 'if command -v fastfetch >/dev/null 2>&1; then fastfetch; fi' >> /home/micro/.bashrc && \
|
||||
echo 'alias fastfetch="fastfetch --config $HOME/.config/fastfetch/config.jsonc"' >> /home/micro/.bashrc && \
|
||||
chown micro:micro /home/micro/.bashrc
|
||||
|
||||
EXPOSE 22
|
||||
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
|
||||
8
micro-fedora43-dev/build-dockerfile.sh
Executable file
8
micro-fedora43-dev/build-dockerfile.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
IMAGE_NAME="$(basename "$(pwd)")"
|
||||
|
||||
echo "Building Docker image: ${IMAGE_NAME}:latest"
|
||||
docker build -t "${IMAGE_NAME}:latest" .
|
||||
|
||||
15
micro-fedora43-dev/fastfetch_config.json
Normal file
15
micro-fedora43-dev/fastfetch_config.json
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"display": {
|
||||
"separator": " == "
|
||||
},
|
||||
"modules": [
|
||||
"title",
|
||||
"os",
|
||||
"kernel",
|
||||
"cpu",
|
||||
"memory",
|
||||
"disk",
|
||||
"shell"
|
||||
]
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue