grim/docker-noop

Get smaller

2016-05-02, Gary Kramlich
f538df99605b
Parents c6febcfa47d9
Children 1701b53e73fa
Get smaller
  • +3 -0
    .hgignore
  • +4 -2
    Dockerfile
  • +18 -0
    Makefile
  • +2 -3
    README.md
  • +0 -0
    noop
  • +9 -0
    noop.asm
  • --- /dev/null Thu Jan 01 00:00:00 1970 +0000
    +++ b/.hgignore Mon May 02 14:45:02 2016 -0500
    @@ -0,0 +1,3 @@
    +syntax: glob
    +*.o
    +
    --- a/Dockerfile Fri Nov 06 11:12:59 2015 -0600
    +++ b/Dockerfile Mon May 02 14:45:02 2016 -0500
    @@ -1,4 +1,6 @@
    -FROM alpine:latest
    +FROM scratch
    -CMD ["true"]
    +COPY noop /
    +ENTRYPOINT ["/noop"]
    +
    --- /dev/null Thu Jan 01 00:00:00 1970 +0000
    +++ b/Makefile Mon May 02 14:45:02 2016 -0500
    @@ -0,0 +1,18 @@
    +#!/usr/bin/make -f
    +
    +.PHONY: all image clean
    +
    +all: noop
    +
    +clean:
    + rm -f noop *.o
    +
    +%.o: %.asm
    + nasm -f elf $< -o $@
    +
    +noop: noop.o
    + gcc -m32 -Wall -s -nostdlib $< -o $@
    +
    +image: noop
    + docker build -t noop .
    +
    --- a/README.md Fri Nov 06 11:12:59 2015 -0600
    +++ b/README.md Mon May 02 14:45:02 2016 -0500
    @@ -1,4 +1,4 @@
    -This is a simple docker container that just runs /bin/true.
    +This is a simple docker container that just runs exits successfully.
    I use it with my docker-compose.override.yml files to not waste a bunch of
    resources when using a shared service during development.
    @@ -7,7 +7,7 @@
    redis:
    image: redis:2.8
    -
    +
    app:
    build: .
    links:
    @@ -32,4 +32,3 @@
    immediately instead of sitting around wasting resources which can't be used by
    anything else.
    -
    Binary file noop has changed
    --- /dev/null Thu Jan 01 00:00:00 1970 +0000
    +++ b/noop.asm Mon May 02 14:45:02 2016 -0500
    @@ -0,0 +1,9 @@
    +; noop.asm
    +BITS 32
    +GLOBAL _start
    +SECTION .text
    +_start:
    + mov eax, 1 ; exit syscall
    + mov ebx, 0 ; exit code
    + int 0x80 ; run syscall
    +