Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docker-optimize

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docker-optimize

A simple program to optimize docker files.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

docker-optimize

Optimize Dockerfiles, so the final docker image will have fewer layers.

Optimizations:

  • Collapse multiple RUN statements into a single one.
  • Collapse multiple ENV declarations into a single one.

Install

npm install -g docker-optimize

Usage

docker-optimize Dockerfile.build > Dockerfile

Dockerfile.build (input)

FROM ubuntu:16.04
MAINTAINER Bogdan Mustiata <bogdan.mustiata@gmail.com>

RUN apt-get update -y && apt-get upgrade -y

RUN useradd -m raptor

ENV UID=1000
ENV GID=1000

CMD perl -pi -e "s/raptor:x:1000:1000/raptor:x:$UID:$GID/" /etc/passwd && \
    perl -pi -e "s/raptor:x:1000:/raptor:x:$GID:/" /etc/group

RUN apt-get install -y\
    libav-tools \
    gimp

ADD bin/create-gif.py /usr/lib/gimp/2.0/plug-ins/create-gif.py

USER raptor

ENV INPUT_FILE=/tmp/in/test.avi
ENV OUTPUT_FILE=/tmp/out/test.gif

#
# The name of the file name that will be saved in the writing
# folder.
#
ENV WRITE_FOLDER=/tmp/write
ENV OUTPUT_FILE_NAME=test.gif
ENV SCALING_FACTOR=1

ADD bin /home/raptor/bin

CMD /home/raptor/bin/run_conversion.sh $OUTPUT_FILE_NAME $SCALING_FACTOR

Dockerfile (output)

# Optimized by docker-optimize: https://www.npmjs.com/package/docker-optimize
FROM ubuntu:16.04
MAINTAINER Bogdan Mustiata <bogdan.mustiata@gmail.com>
ENV { "UID":"1000","GID":"1000" }
CMD perl -pi -e "s/raptor:x:1000:1000/raptor:x:$UID:$GID/" /etc/passwd &&      perl -pi -e "s/raptor:x:1000:/raptor:x:$GID:/" /etc/group
ADD bin/create-gif.py /usr/lib/gimp/2.0/plug-ins/create-gif.py
RUN apt-get update -y && apt-get upgrade -y && useradd -m raptor && apt-get install -y     libav-tools      gimp
USER raptor
ENV { "INPUT_FILE":"/tmp/in/test.avi","OUTPUT_FILE":"/tmp/out/test.gif","WRITE_FOLDER":"/tmp/write","OUTPUT_FILE_NAME":"test.gif","SCALING_FACTOR":"1" }
ADD bin /home/raptor/bin
CMD /home/raptor/bin/run_conversion.sh $OUTPUT_FILE_NAME $SCALING_FACTOR

FAQs

Package last updated on 03 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc