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

Add generic platform #22

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

last-g
Copy link
Contributor

@last-g last-g commented Jun 30, 2020

This offers a generic platform that can be used to easily bootstrap any language or technology.
It provides both build-time extension point and run-time extension point.
It also provides a prepare_build.sh script in attempt to make the build faster and cache friendly.

This is a followup to the discussion in #11

Tested locally:

➜  generic git:(generic_image) docker build .
Sending build context to Docker daemon  8.192kB
Step 1/9 : FROM ubuntu:20.04
 ---> 74435f89ab78
Step 2/9 : RUN apt-get update && apt-get install -y locales     build-essential openssl libssl-dev ca-certificates     && apt-get clean     && rm -rf /var/lib/apt/lists/*     && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
 ---> Using cache
 ---> 48eb127c62ef
Step 3/9 : ENV LANG en_US.utf8
 ---> Using cache
 ---> 1ea6eb467afb
Step 4/9 : WORKDIR /source
 ---> Using cache
 ---> 3523da384f71
Step 5/9 : COPY ./prepare_build.sh .
 ---> b3f9a2d729f8
Step 6/9 : RUN /bin/bash /source/prepare_build.sh
 ---> Running in 2b3dbdc45330
Removing intermediate container 2b3dbdc45330
 ---> 0c68c165efd7
Step 7/9 : COPY . .
 ---> c0f6bd3483cb
Step 8/9 : RUN /bin/bash /source/build.sh
 ---> Running in 53e4646e42e7
Removing intermediate container 53e4646e42e7
 ---> 708c6808d48b
Step 9/9 : ENTRYPOINT ["/bin/bash", "/source/run.sh"]
 ---> Running in bec24911c549
Removing intermediate container bec24911c549
 ---> b11b74861e80
Successfully built b11b74861e80
➜  generic git:(generic_image) docker run -it --rm b11b74861e80 'Whos there?'
Hello, World! and Whos there?

# This is effectively required to build and link any other language executable

RUN apt-get update && apt-get install -y locales \
build-essential openssl libssl-dev ca-certificates \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

questionable actually

@beevee
Copy link
Member

beevee commented Jul 2, 2020

I'm afraid it won't work, because we restrict Internet access during build. apt-get will fail.

You should split your Dockerfile into two separate images:

  1. Base image with all necessary dependencies installed (Internet access allowed during build).
  2. Runnable image with team's submission (Internet access not allowed during build).

You can refer to a nice working example here: https://github.com/icfpcontest2020/dockerfiles/tree/master/dockerfiles/bazel

@beevee
Copy link
Member

beevee commented Jul 17, 2020

Can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants