mirror of
https://github.com/rancher/os.git
synced 2025-10-21 15:34:46 +00:00
Refactor build scripts
This commit is contained in:
22
images/10-fedoraconsole/Dockerfile
Normal file
22
images/10-fedoraconsole/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM rancher/os-fedoraconsole-base
|
||||
# FROM amd64=fedora:23 arm64=rancher/aarch64-fedora:23 arm=armv7/armhf-fedora:23
|
||||
RUN dnf upgrade -y && \
|
||||
dnf install -y iptables openssh-server rsync sudo vim less ca-certificates psmisc htop
|
||||
RUN rm -rf /etc/ssh/*key*
|
||||
RUN rm -fr /sbin/poweroff /sbin/shutdown /sbin/reboot /sbin/halt /usr/sbin/poweroff /usr/sbin/shutdown /usr/sbin/reboot /usr/sbin/halt
|
||||
RUN ln -s /sbin/agetty /sbin/getty
|
||||
COPY build/entry.sh build/console.sh build/docker-init build/update-ssh-keys build/rancheros-install /usr/sbin/
|
||||
RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8
|
||||
RUN groupadd --gid 1100 rancher && \
|
||||
groupadd --gid 1101 docker && \
|
||||
useradd -u 1100 -g rancher -G docker,wheel -m -s /bin/bash rancher && \
|
||||
useradd -u 1101 -g docker -G docker,wheel -m -s /bin/bash docker && \
|
||||
echo ClientAliveInterval 180 >> /etc/ssh/sshd_config && \
|
||||
echo '## allow password less for rancher user' >> /etc/sudoers && \
|
||||
echo 'rancher ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
|
||||
echo '## allow password less for docker user' >> /etc/sudoers && \
|
||||
echo 'docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
|
||||
ln -sf /usr/bin/docker.dist /usr/bin/docker
|
||||
COPY prompt.sh /etc/profile.d/
|
||||
ENTRYPOINT ["/usr/sbin/entry.sh"]
|
||||
CMD ["/usr/sbin/console.sh"]
|
12
images/10-fedoraconsole/prebuild.sh
Executable file
12
images/10-fedoraconsole/prebuild.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd $(dirname $0)
|
||||
|
||||
rm -rf ./build
|
||||
mkdir -p ./build
|
||||
cp ./../01-base/entry.sh ./build/
|
||||
cp ./../02-console/console.sh ./build/
|
||||
cp ./../02-console/docker-init ./build/
|
||||
cp ./../02-console/update-ssh-keys ./build/
|
||||
cp ./../02-console/rancheros-install ./build/
|
1
images/10-fedoraconsole/prompt.sh
Normal file
1
images/10-fedoraconsole/prompt.sh
Normal file
@@ -0,0 +1 @@
|
||||
export PS1='[\u@\h \W]\$ '
|
Reference in New Issue
Block a user