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

Create onbuild variant that runs swift build and potentially executes the output #54

Closed
swizzlr opened this issue Jan 13, 2017 · 3 comments

Comments

@swizzlr
Copy link
Contributor

swizzlr commented Jan 13, 2017

cf. docker-library/python#77

Perhaps this could work?

ONBUILD COPY Package.swift /code/
ONBUILD RUN swift build -c release # cache dependency build artefacts
ONBUILD COPY Sources /code/
ONBUILD RUN swift build -c release # specify destination for output binary
CMD # predefined output binary
@johnlinvc
Copy link

I successfully built a simple hello world package with following onbuild setup.

FROM swift:3.0.2
WORKDIR /code
ONBUILD COPY Package.swift /code/
ONBUILD RUN swift build -c release # cache dependency build artefacts
ONBUILD COPY Sources /code/
ONBUILD RUN swift build -c release # specify destination for output binary
CMD ["/bin/bash", "-c", "find .build -executable -type f -not -name '*.so' | head | bash"]

the CMD will find the first non .so built executable and run it.

@swizzlr
Copy link
Contributor Author

swizzlr commented Feb 9, 2017

Could you propose that as a PR?

@swizzlr
Copy link
Contributor Author

swizzlr commented Nov 10, 2017

Closing per deprecation of onbuild in official images.

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

No branches or pull requests

2 participants