no need for a home dir
This commit is contained in:
parent
627ba50ef3
commit
33ffa1d6f7
2 changed files with 6 additions and 10 deletions
14
Dockerfile
14
Dockerfile
|
@ -5,7 +5,6 @@ ARG GID="1000"
|
|||
|
||||
# setup pacman
|
||||
USER root
|
||||
COPY etc/profile.d/devkitpro.sh /etc/profile.d
|
||||
RUN pacman-key --init
|
||||
RUN pacman-key --recv BC26F752D25B92CE272E0F44F7FD5492264BB9D0 --keyserver keyserver.ubuntu.com
|
||||
RUN pacman-key --lsign BC26F752D25B92CE272E0F44F7FD5492264BB9D0
|
||||
|
@ -16,21 +15,20 @@ RUN echo Include = /etc/pacman.d/devkitpro.conf >> /etc/pacman.conf
|
|||
RUN pacman -Syu --noconfirm
|
||||
|
||||
# install tools
|
||||
RUN pacman -Sy --noconfirm base-devel openssh $TOOLS
|
||||
RUN pacman -Sy --noconfirm base-devel openssh vim $TOOLS
|
||||
|
||||
# setup environment
|
||||
RUN groupadd -g $GID devkitpro
|
||||
RUN useradd -u $UID -g $GID -mN devkitpro
|
||||
RUN useradd -u $UID -g $GID -lNd / devkitpro
|
||||
RUN ssh-keygen -A
|
||||
RUN sed -i "s|#Port 22|Port 2222|g" /etc/ssh/sshd_config
|
||||
RUN chown devkitpro:devkitpro /etc/ssh/ssh_host*
|
||||
RUN mkdir /home/devkitpro/.ssh
|
||||
RUN sed -i "s|AuthorizedKeysFile.*|AuthorizedKeysFile /etc/ssh/authorized_keys|g" /etc/ssh/sshd_config
|
||||
RUN --mount=type=secret,id=key,target=/root/id.pub \
|
||||
cp /root/id.pub /home/devkitpro/.ssh/authorized_keys
|
||||
RUN chown devkitpro -R /home/devkitpro
|
||||
cp /root/id.pub /etc/ssh/authorized_keys
|
||||
RUN chown devkitpro:devkitpro /etc/ssh/ssh_host* /etc/ssh/authorized_keys
|
||||
COPY etc/environment /etc/environment
|
||||
USER devkitpro
|
||||
WORKDIR /volume
|
||||
RUN echo cd /volume >> /home/devkitpro/.bashrc
|
||||
EXPOSE 2222/tcp
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
# use docker exec to access container OR
|
||||
|
|
2
etc/profile.d/devkitpro.sh → etc/environment
Executable file → Normal file
2
etc/profile.d/devkitpro.sh → etc/environment
Executable file → Normal file
|
@ -1,5 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
DEVKITPRO=/opt/devkitpro
|
||||
DEVKITARM=/opt/devkitpro/devkitARM
|
||||
DEVKITPPC=/opt/devkitpro/devkitPPC
|
Loading…
Add table
Reference in a new issue