You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM ubuntu:trusty
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/UsePam yes/UsePam no/' /etc/ssh/sshd_config
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
$ docker build -t lesson/service-solo service/solo/
$ docker run -d -p 2222:22 lesson/service-solo
$ ssh root@$(boot2docker ip) -p 2222 \
-oStrictHostKeyChecking=no \
-oUserKnownHostsFile=/dev/null # sshconfigのおまじない[email protected]'s password: Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.2.0-54-generic x86_64) * Documentation: https://help.ubuntu.com/The programs included with the Ubuntu system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted byapplicable law.root@f83ab81e48ef:~# root@f83ab81e48ef:~# exitlogout
#!/bin/bash# This is wrapper.sh
/usr/sbin/sshd -D >> /var/log/container.log &
/usr/bin/mongod --dbpath /var/spool/mongodb >> /var/log/container.log &
tail -f /var/log/container.log
FROM ubuntu:trusty
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/UsePam yes/UsePam no/' /etc/ssh/sshd_config
RUN apt-get install -y mongodb
RUN mkdir /var/spool/mongodb
ADD ./wrapper.sh /usr/local/bin/wrapper.sh
RUN chmod a+x /usr/local/bin/wrapper.sh
EXPOSE 22
EXPOSE 27017
CMD /usr/local/bin/wrapper.sh
EXPOSE を有効にするには -P
$ docker build -t lesson/service-multi service/multi/
$ id=$( docker run -d -P lesson/service-multi )
$ docker port $id 22 # or 27017
....
FROM ubuntu:trusty
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y
RUN apt-get install -y wget
RUN apt-get install -y cron munin apache2
# muninの作るmunin.confがApache2.4互換でない...(まめ知識)RUN sed -i 's/Allow from localhost.*/Require all granted/g' /etc/apache2/conf-enabled/munin.conf
RUN sed -i '/Order allow,deny/d' /etc/apache2/conf-enabled/munin.conf
RUN ( mkdir -p /var/run/munin && chown -R munin:munin /var/run/munin )
ADD wrapper.sh /usr/local/bin/wrapper.sh
RUN chmod a+x /usr/local/bin/wrapper.sh
VOLUME /var/lib/munin
VOLUME /var/log/munin
EXPOSE 80
CMD ["/usr/local/bin/wrapper.sh"]
#!/bin/bash# This is wrapper.sh# placeholder html to prevent permission error
cat <<EOF > /var/cache/munin/www/index.html<html>Munin has not run yet. Please try again in a few moments.</html>EOF# make accessible from munin
chown -R munin:munin /var/lib/munin /var/log/munin
chown munin:munin /var/cache/munin/www/index.html
# start cron
/usr/sbin/cron &# start local munin-node
/usr/sbin/munin-node > /dev/null 2>&1&# start apache
/usr/sbin/apache2ctl -DFOREGROUND
$ gem install building highline
$ cd /path/to/app
$ building -f progrium/buildstep lesson/service-buildstep
identical Dockerfile
building docker build -t lesson/service-buildstep:latest .
Sending build context to Docker daemon 8.704 kB
Sending build context to Docker daemon
Step 0 : FROM progrium/buildstep
---> 5e2463ec79bd
Step 1 : ADD . /app
---> 3a7ac4f51633
Removing intermediate container 919307717ba6
Step 2 : RUN /build/builder
---> Running in 493f510dd029
-----> Ruby app detected
-----> Compiling Ruby/Rack
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.6.3
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from http://rubygems.org/..........
Using bundler 1.6.3
Installing tilt 1.4.1
Installing rack 1.5.2
Installing rack-protection 1.5.3
Installing sinatra 1.4.5
Your bundle is complete!
Gems in the groups development and test were not installed.
It was installed into ./vendor/bundle
Bundle completed (9.12s)
Cleaning up the bundler cache.
###### WARNING:
You have not declared a Ruby version in your Gemfile.
To set your Ruby version add this line to your Gemfile:
ruby '2.0.0'# See https://devcenter.heroku.com/articles/ruby-versions for more information.
-----> Discovering process types
Procfile declares types -> web
Default process types for Ruby -> rake, console, web
---> 5debf36082f2
Removing intermediate container 493f510dd029
Step 3 : CMD /start web
---> Running in 8b74b5b7ee74
---> 2bd8bede7de1
Removing intermediate container 8b74b5b7ee74
Successfully built 2bd8bede7de1
hint To run your app, try: docker run -d -p 8080 -e "PORT=8080" lesson/service-buildstep:latest
hint To re-build your app, try: docker build -t lesson/service-buildstep .
$ id=$( docker run -d -p 8080 -e "PORT=8080" lesson/service-buildstep:latest )
$ echo http://$(boot2docker ip):$(docker port $id 8080 | cut -f2 -d:)# and access it
docker build または docker run でコンパイルが走る。結果物はVOLUME、docker cp、標準出力経由などの方法で取り出す。
FROM ubuntu:trusty
RUN apt-get update -y
RUN apt-get install -y git golang-go
# Repo is https://gist.github.com/25f6379bc6e57e9adbe0RUN git clone https://gist.github.com/25f6379bc6e57e9adbe0.git /usr/local/src/helloworld
WORKDIR /usr/local/src/helloworld
RUN chmod a+x ./make.sh
RUN mkdir /var/build
CMD ./make.sh # build and sleep
FROM node:0.10-onbuild
CMD ["./bin/hubot", "-a", "shell"]
$ docker build -t lesson/onbuild-hubot onbuild/
$ docker run -ti lesson/onbuild-hubot
Hubot>
Hubot> hubot help
Hubot> Hubot adapter - Reply with the adapter
Hubot animate me <query> - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
Hubot echo<text> - Reply back with <text>
Hubot help - Displays all of the help commands that Hubot knows about.
Hubot help<query> - Displays all help commands that match <query>.
Hubot image me <query> - The Original. Queries Google Images for<query> and returns a random top result.
...