Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dockerfile to use slim image base #600

Merged
merged 3 commits into from
Dec 24, 2017
Merged

Update dockerfile to use slim image base #600

merged 3 commits into from
Dec 24, 2017

Conversation

mbeacom
Copy link
Contributor

@mbeacom mbeacom commented Dec 22, 2017

- What I did

Modified the Dockerfile to use http://label-schema.org/rc1/ syntax to label the docker image and switched the base image to use the latest slim 3.6 base image.
This decreases the docker image size from 740MB to 278MB without any usage/compatibility changes.

- How I did it

  • Removed deprecated MAINTAINER directive.
  • Added new LABEL directives adhering to label schema specific to the repository.
  • Modified the base image from python:3.6 to python:3.6-slim
  • Modified installed dependencies to install only whats necessary and purge them following build of package.
  • Switch from cloning the github repository to using the existing repository, since we're already in the repo.

- How to verify it

  • Run make docker-build

- Description for the changelog

  • Switch Dockerfile to python:3.6-slim from python:3.6 to decrease size from 740MB to 278MB.

- Cute Animal Picture

Viper

@fubuloubu
Copy link
Member

LGTM thanks

Makefile Outdated
@@ -25,3 +25,8 @@ docs:
$(MAKE) -C docs clean
$(MAKE) -C docs html
open docs/_build/html/index.html

docker-build:
@docker build \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For make docker-build to work I needed to add -t viper ., @mbeacom does it work without that for you?

@docker build -t viper . \
		--build-arg VCS_REF=`git rev-parse --short HEAD` \

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidKnott Yes, it seems to work fine on my end:

~/C/viper   slim-docker  make docker-build           Sat Dec 23 14:58:37 2017
Sending build context to Docker daemon  2.009MB
Step 1/8 : FROM python:3.6-slim
3.6-slim: Pulling from library/python
c4bb02b17bb4: Already exists

I can add the tag to it, though! Wasn't sure if we wanted to tag it or not.

@DavidKnott
Copy link
Contributor

@mbeacom Thanks a lot! merging this in.

@DavidKnott DavidKnott merged commit d6c0e1d into vyperlang:master Dec 24, 2017
@mbeacom mbeacom deleted the slim-docker branch December 26, 2017 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants