Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
json-editor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IOPSYS
json-editor
Commits
2568f691
Commit
2568f691
authored
5 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
add docker image for development
parent
44b32937
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+118
-0
118 additions, 0 deletions
Dockerfile
entrypoint.sh
+16
-0
16 additions, 0 deletions
entrypoint.sh
supervisord.conf
+11
-0
11 additions, 0 deletions
supervisord.conf
with
145 additions
and
0 deletions
Dockerfile
0 → 100644
+
118
−
0
View file @
2568f691
FROM
ubuntu:16.04
LABEL
maintainer="jakob.olsson@iopsys.eu"
LABEL
build="docker build -t iopsys/json-editor ."
LABEL
run="docker run -d --name json-editor --privileged --rm -v ${PWD}:/opt/work -p 12345:22 -e LOCAL_USER_ID=`id -u $USER` iopsys/json-editor:latest"
LABEL
exec="docker exec --user=user -it json-editor bash"
LABEL
stop="docker stop json-editor"
RUN
\
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
\
# general tools
git \
cmake \
wget \
build-essential \
lcov \
apt-utils \
autoconf \
automake \
pkg-config \
libtool \
vim \
valgrind \
gdb \
cppcheck \
python3 \
python3-setuptools \
openssh-server \
clang-format \
sudo \
strace \
supervisor \
net-tools \
iputils-ping
# Configure OpenSSH server
RUN
mkdir
/var/run/sshd
RUN
echo
'root:root'
| chpasswd
RUN
sed
-i
's/PermitRootLogin prohibit-password/PermitRootLogin yes/'
/etc/ssh/sshd_config
RUN
sed
-i
's/PermitEmptyPasswords no/PermitEmptyPasswords yes/'
/etc/ssh/sshd_config
RUN
sed
's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g'
-i
/etc/pam.d/sshd
# Configure gdb-dashboard
RUN
\
easy_install3 pip
&&
\
pip3
install
Pygments
RUN
wget
-P
~ git.io/.gdbinit
RUN
\
mkdir
~/.gdbinit.d
&&
\
touch
~/.gdbinit.d/init
&&
\
echo
"dashboard -layout source"
>>
~/.gdbinit.d/init
&&
\
echo
"dashboard source -style context 20"
>>
~/.gdbinit.d/init
&&
\
echo
"dashboard -style syntax_highlighting 'monokai'"
>>
~/.gdbinit.d/init
# Install dependent libraries
RUN
\
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
\
lua5.1-dev
\
lua5.1
\
#libjson0
\
#libjson0-dev
\
libssl-dev
\
libuv1-dev
\
cmocka-doc
\
libcmocka-dev
\
libcmocka0
# Install CMocka
#RUN \
# git clone --branch cmocka-1.1.1 git://git.cryptomilk.org/projects/cmocka.git && \
# cd cmocka && \
# mkdir build && \
# cd build && \
# cmake .. && \
# make && \
# make install
# Remove cached packages.
RUN
rm
-rf
/var/lib/apt/lists/
*
RUN
mkdir
/opt/dev
# Install JSON-C
RUN
\
cd
/opt/dev
&&
\
git clone https://github.com/json-c/json-c.git
&&
\
cd
json-c
&&
\
sh autogen.sh
&&
\
./configure
&&
\
make
&&
\
make
install
&&
\
sudo
ldconfig
# ubox
RUN
\
cd
/opt/dev
&&
\
git clone git://git.openwrt.org/project/libubox.git
&&
\
cd
libubox
&&
mkdir
build
&&
cd
build
&&
\
git checkout fd57eea9f37e447814afbf934db626288aac23c4
&&
\
cmake
-DCMAKE_INSTALL_PREFIX
=
/usr
-DCMAKE_BUILD_TYPE
:String
=
"Release"
..
&&
\
make
-j2
&&
\
make
install
RUN
mkdir
/etc/config
WORKDIR
/opt/work
# Expose ports
EXPOSE
22
# Prepare supervisor
RUN
mkdir
-p
/var/log/supervisor
COPY
supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Start entrypoint
COPY
entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT
["/usr/local/bin/entrypoint.sh"]
This diff is collapsed.
Click to expand it.
entrypoint.sh
0 → 100755
+
16
−
0
View file @
2568f691
#!/bin/bash
# Create user
USER_ID
=
${
LOCAL_USER_ID
:-
9001
}
useradd
--shell
/bin/bash
-u
$USER_ID
-G
sudo
-o
-c
""
-m
user
adduser
--disabled-password
user
export
HOME
=
/home/user
echo
"user ALL = NOPASSWD : ALL"
>>
/etc/sudoers
# Configure OpenSSH to allow login without password
sed
-i
-re
's/^user:[^:]+:/user::/'
/etc/passwd /etc/shadow
pam_config
=
"auth [success=1 default=ignore] pam_unix.so nullok
\n
auth requisite pam_deny.so
\n
auth required pam_permit.so"
sed
-i
"s/@include common-auth/
$pam_config
/"
/etc/pam.d/sshd
# Start supervisor
/usr/bin/supervisord
-c
/etc/supervisor/conf.d/supervisord.conf
-l
/var/log/supervisord.log
-j
/var/run/supervisord.pid
This diff is collapsed.
Click to expand it.
supervisord.conf
0 → 100644
+
11
−
0
View file @
2568f691
[
supervisord
]
nodaemon
=
true
[
program
:
ubusd
]
command
=/
bin
/
bash
-
c
"/usr/sbin/ubusd"
[
program
:
rpcd
]
command
=/
bin
/
bash
-
c
"/usr/sbin/rpcd"
[
program
:
sshd
]
command
=/
usr
/
sbin
/
sshd
-
D
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment