Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
inconsole authored Oct 15, 2016
1 parent ea5eb4a commit 5bff7c4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
37 changes: 37 additions & 0 deletions temp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM redis:2.8.13

# switch to root to build image
# =================================================
USER root

# prepare rootfs
# =================================================
RUN mkdir /rootfs
WORKDIR /rootfs
RUN mkdir bin etc dev dev/pts lib usr proc sys tmp
RUN mkdir -p usr/lib64 usr/bin usr/local/bin
RUN touch etc/resolv.conf
RUN cp /etc/nsswitch.conf etc/nsswitch.conf
RUN echo root:x:0:0:root:/:/bin/sh > etc/passwd
RUN echo root:x:0: > etc/group
RUN ln -s lib lib64
RUN ln -s bin sbin

# install busybox
# =================================================
ADD https://busybox.net/downloads/binaries/1.21.1/busybox-x86_64 /sbin/busybox
RUN chmod +x /sbin/busybox
RUN cp /sbin/busybox bin
RUN busybox --install -s bin

# extract redis-server
# =================================================
RUN cp /usr/local/bin/redis-server usr/bin/redis-server

# extract redis-server's dependencies
# =================================================
RUN bash -c "cp /lib/x86_64-linux-gnu/lib{m,dl,pthread,c}.so.* lib64"
RUN cp /lib64/ld-linux-x86-64.so.2 lib64/

# build rootfs
RUN tar cf /rootfs.tar .
5 changes: 5 additions & 0 deletions temp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$docker run -d temp:latest
$docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2779bca0c7e5 temp:latest "/entrypoint.sh demo" 2 seconds ago Up 1 seconds 6379/tcp stoic_galileo
$docker cp 2779bca0c7e5:/rootfs.tar /tmp/

0 comments on commit 5bff7c4

Please sign in to comment.