Skip to content

Instantly share code, notes, and snippets.

@the-snowwhite
Created November 26, 2020 02:18
Show Gist options
  • Save the-snowwhite/433e95b921d0f6f00f60bc9e107fbacd to your computer and use it in GitHub Desktop.
Save the-snowwhite/433e95b921d0f6f00f60bc9e107fbacd to your computer and use it in GitHub Desktop.
Emcapp Machinekit sim Docker file
FROM debian:buster
# build with: docker build -t mksim:buster .
SHELL [ "bash", "-c" ]
ENV TERM=dumb
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true
ENV LC_ALL=C.UTF-8
ENV LANGUAGE=C.UTF-8
ENV LANG=C.UTF-8
RUN printf "%s;\n%s;\n" \
'APT::Install-Recommends "0"' \
'APT::Install-Suggests "0"' \
> /etc/apt/apt.conf.d/01norecommend
RUN apt-get update && \
apt-get install -y \
curl \
apt-transport-https \
ca-certificates && \
curl -1sLf \
'https://dl.cloudsmith.io/public/machinekit/machinekit/cfg/setup/bash.deb.sh' \
| bash && \
curl -1sLf \
'https://dl.cloudsmith.io/public/machinekit/machinekit-hal/cfg/setup/bash.deb.sh' \
| bash && \
apt-get clean
RUN apt-get update && \
apt-get -y upgrade && \
apt-get clean
ENV USER=machinekit
RUN addgroup --gid 1000 ${USER} && \
adduser --uid 1000 --ingroup ${USER} --home /home/${USER} \
--shell /bin/bash --disabled-password --gecos "" ${USER}
RUN apt-get update && \
apt-get install -y \
sudo \
machinekit-fixuid && \
apt-get clean
COPY base-entrypoint.sh /opt/bin/base-entrypoint.sh
RUN chmod +x /opt/bin/base-entrypoint.sh && \
mkdir /opt/environment && \
echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers && \
mkdir -p /etc/fixuid && \
printf "user: ${USER}\ngroup: ${USER}\n" > /etc/fixuid/config.yml
ENTRYPOINT [ "/opt/bin/base-entrypoint.sh" ]
#RUN apt-get update && \
# apt-get install -y \
# dbus \
# avahi-daemon \
# machinekit-hal \
# machinekit-hal-dev \
# git && \
# apt-get clean;
RUN apt-get update && \
apt-get install -y \
dbus \
avahi-daemon \
git && \
apt-get clean;
#RUN mkdir -p /var/run/dbus && \
# sed -i 's/^REMOTE=0/REMOTE=1/' /etc/machinekit/machinekit.ini
RUN mkdir -p /var/run/dbus
RUN cd /home/machinekit && \
git clone https://github.com/machinekit/Machineface.git && \
git clone https://github.com/machinekit/Cetus.git && \
git clone https://github.com/the-snowwhite/mkwrapper-sim.git -b lcnc2.9
USER machinekit
WORKDIR /home/machinekit
RUN sudo chown -R machinekit:machinekit Cetus Machineface mkwrapper-sim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment