forked from crops/poky-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (47 loc) · 2.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright (C) 2015-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
FROM crops/yocto:ubuntu-14.04-base
ARG SDK_INSTALLER_URL_ARG
ARG SDK_INSTALLER_ARG
ENV SDK_INSTALLER=$SDK_INSTALLER_ARG
USER root
ADD https://raw.githubusercontent.com/crops/extsdk-container/master/restrict_useradd.sh \
https://raw.githubusercontent.com/crops/extsdk-container/master/restrict_groupadd.sh \
https://raw.githubusercontent.com/crops/extsdk-container/master/usersetup.py \
/usr/bin/
ADD $SDK_INSTALLER_URL_ARG /opt
COPY poky-entry.py poky-launch.sh /usr/bin/
COPY sudoers.usersetup /etc/
# We remove the user because we add a new one of our own.
# The usersetup user is solely for adding a new user that has the same uid,
# as the workspace. 70 is an arbitrary *low* unused uid on debian.
RUN userdel -r yoctouser && \
groupadd -g 70 usersetup && \
useradd -N -m -u 70 -g 70 usersetup && \
chmod 755 /usr/bin/usersetup.py \
/usr/bin/poky-entry.py \
/usr/bin/poky-launch.sh \
/usr/bin/restrict_groupadd.sh \
/usr/bin/restrict_useradd.sh && \
echo "#include /etc/sudoers.usersetup" >> /etc/sudoers && \
chmod a+x /opt/${SDK_INSTALLER} && \
sync && \
/opt/${SDK_INSTALLER} -y && \
rm /opt/${SDK_INSTALLER} && \
apt-get -y install rpcbind net-tools dnsutils && \
echo 'OPTIONS="-i -w"' > /etc/default/rpcbind
USER root
ENV LANG=en_US.UTF-8
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/bin/poky-entry.py"]