Giter Site home page Giter Site logo

dockerfileview's Introduction

dockerfileview - a Dockerfile viewer to trace ancestry of the base image

dockerfileview is a dead simple command line tool enable you to trace ancestry of the base image. Here is an example.

$ dockerfileview nginx:1.9.2

#
# 🐳  debian:jessie
# https://raw.githubusercontent.com/tianon/docker-brew-debian/e9bafb113f432c48c7e86c616424cb4b2f2c7a51/jessie/Dockerfile
#

FROM scratch
ADD rootfs.tar.xz /
CMD ["/bin/bash"]

#
# 🐳  nginx:1.9.2
# https://raw.githubusercontent.com/nginxinc/docker-nginx/1eea9f7d082dff426e7923a90138de804038266d/Dockerfile
#

FROM debian:jessie

MAINTAINER NGINX Docker Maintainers "[email protected]"

 .
 .
 .

There are tons of useful public docker images such as official images(e.g. ubuntu:14.04 or centos:latest) and personal images hosted at registry.hub.docker.com(e.g. jwilder/nginx-proxy), but to download Dockerfiles of those public images are boring and tiresome work. To make matters worse, you sometimes need to trace ancestry to investigate "base image of base image of current image" kind of thing manually. This is where dockerfileview comes in.

command line example

Installation

To install dockerfileview, please use go get.

$ go get github.com/remore/dockerfileview

If you have not installed go on your system, precompiled executables are available at release page is for you. Or, simply type docker run command such as:

$ docker run remore/dockerfileview dockerfileview ubuntu:14.04

Usage

dockerfileview can take a local file path for Dockerfile or public docker image name.

$ dockerfileview /path/to/Dockerfile
...
$ dockerfileview centos
...
$ dockerfileview nginx:1.9.2
...
$ dockerfileview jwilder/nginx-proxy

In case of redirecting standard output to to other command such as less or tail via pipe, --text option is recommended to use.

$ dockerfileview --text centos | less

#
# centos
# https://raw.githubusercontent.com/CentOS/sig-cloud-instance-images/0a6a7fa816e834b29222fce2df0b858ab1b97a87/docker/Dockerfile
#

FROM scratch
MAINTAINER The CentOS Project <[email protected]> - ami_creator
ADD centos-7-20150616_1752-docker.tar.xz /
# Volumes for systemd
# VOLUME ["/run", "/tmp"]

# Environment for systemd
# ENV container=docker

# For systemd usage this changes to /usr/sbin/init
# Keeping it as /bin/bash for compatability with previous


CMD ["/bin/bash"]

#
# (Direct Input from CLI)
#

FROM centos

Limitations(there are certain types of unsupported image name)

Please be noted that regarding with docker image name, official images and latest image registered at public docker registry are supported. Meanwhile, here is the list of example image names we doesn't support.

  • public_user/repo:
  • localhost:50111/foobar

This is because internally dockerfileview command will only fetch public information by connection to either registry.hub.docker.com or raw.githubusercontent.com to retrieve public Dockerfile.

dockerfileview's People

Contributors

citruspi avatar remore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dockerfileview's Issues

It seems that it doesn't work anymore

Hey, I wanted to find some dockerfile. Then I found your tool, but saddly it seems that it no longer works :(

βœ— docker run remore/dockerfileview dockerfileview ubuntu:14.04
Unable to find image 'remore/dockerfileview:latest' locally
latest: Pulling from remore/dockerfileview
4d2e9ae40c41: Pull complete
a3ed95caeb02: Pull complete
c82d0202dda4: Pull complete
c33eb106dfcf: Pull complete
f9a0522cbaa2: Pull complete
bad54a5c2ae3: Pull complete
44590cce7a4f: Pull complete
ea2a9399d365: Pull complete
ddf532273b60: Pull complete
b11d7fb3bbe8: Pull complete
Digest: sha256:d5dd58688f507bc8e6b3723e1ff899a744542edac9f3eb6ffb8c37985416f116
Status: Downloaded newer image for remore/dockerfileview:latest

#
# 🐳  ubuntu:14.04
#

Failed to fetch ubuntu:14.04

#
# 🐳  (Direct Input from CLI)
#

FROM ubuntu:14.04

Failed to fetch ...

jem@Jems-MacBook-Pro:~/projects぀ docker run remore/dockerfileview dockerfileview ubuntu:14.04
Unable to find image 'remore/dockerfileview:latest' locally
latest: Pulling from remore/dockerfileview
4d2e9ae40c41: Pull complete
a3ed95caeb02: Pull complete
c82d0202dda4: Pull complete
c33eb106dfcf: Pull complete
f9a0522cbaa2: Pull complete
bad54a5c2ae3: Pull complete
44590cce7a4f: Pull complete
ea2a9399d365: Pull complete
ddf532273b60: Pull complete
b11d7fb3bbe8: Pull complete
Digest: sha256:d5dd58688f507bc8e6b3723e1ff899a744542edac9f3eb6ffb8c37985416f116
Status: Downloaded newer image for remore/dockerfileview:latest

#
# 🐳  ubuntu:14.04
#

Failed to fetch ubuntu:14.04

#
# 🐳  (Direct Input from CLI)
#

Doesnt work in CentOS

[root@2741bb68dc74 tomcat]# go get github.com/remore/dockerfileview
# github.com/remore/dockerfileview
/root/go/src/github.com/remore/dockerfileview/main.go:16:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
        cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
/root/go/src/github.com/remore/dockerfileview/main.go:22:13: cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in assignment

cannot use cli.BoolFlag literal

go get github.com/remore/dockerfileview

gives error:

# github.com/remore/dockerfileview
go/src/github.com/remore/dockerfileview/main.go:16:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/remore/dockerfileview/main.go:22:13: cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in assignment

on Manjaro linux

Unable to fetch public images

I am trying to fetch the nginx:alpine image. It is a public image.

I am getting the following error.

ubuntu@ubuntu-xenial:~/dockerfileview/dockerfileview$ ./dockerfile nginx:alpine

#
# 🐳  nginx:alpine
#

Failed to fetch nginx:alpine

#
# 🐳  (Direct Input from CLI)
#

FROM nginx:alpine

`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.