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

[DO NOT MERGE] WIP Test to build artefacts in the Dockerfile #405

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Oct 28, 2019

Just some dirty hacking to see what would be needed to build the binaries as part of docker build, instead of in the deb/rpm specific tools. Still lots of work to be done to make this a usable approach, but doesn't hurt to give it a quick try.

Try building as an image

make \
  UBUNTU_VERSIONS=ubuntu-bionic \
  DEBIAN_VERSIONS="" \
  deb

Note that we didn't build containerd or runc, so
we can't run the daemon. We can try the cli against a
daemon on the host though;

docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock debbuild-ubuntu-bionic/x86_64

Try building, and put binaries in deb/build

make \
  UBUNTU_VERSIONS=ubuntu-bionic \
  DEBIAN_VERSIONS="" \
  binaries

Artefacts will be stored in deb/build

ls -la deb/build
total 0
drwx------   6 sebastiaan  staff  192 Oct 28 16:17 .
drwxr-xr-x  19 sebastiaan  staff  608 Oct 28 16:17 ..
drwxr-xr-x   7 sebastiaan  staff  224 Oct 28 16:17 bin
drwxr-xr-x   4 sebastiaan  staff  128 Oct 28 16:17 cli-plugins
drwxr-xr-x   6 sebastiaan  staff  192 Oct 28 16:17 completion
drwxr-xr-x   3 sebastiaan  staff   96 Oct 28 16:17 man


FROM build-base AS deb
Copy link
Member Author

Choose a reason for hiding this comment

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

Haven't tried this stage; the idea will be to;

  1. build artefacts
  2. copy them to this stage
  3. run deb (/rpm) specific steps to package the artefacts as a .deb or .rpm

Try building as an image
-------------------------------

```bash
make \
  UBUNTU_VERSIONS=ubuntu-bionic \
  DEBIAN_VERSIONS="" \
  deb
```

Note that we didn't build containerd or runc, so
we can't run the daemon. We can try the cli against a
daemon on the host though;

```bash
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock debbuild-ubuntu-bionic/x86_64
```

Try building, and put binaries in deb/build
--------------------------------------------

```bash
make \
  UBUNTU_VERSIONS=ubuntu-bionic \
  DEBIAN_VERSIONS="" \
  binaries
```

Artefacts will be stored in deb/build

```bash
ls -la deb/build
total 0
drwx------   6 sebastiaan  staff  192 Oct 28 16:17 .
drwxr-xr-x  19 sebastiaan  staff  608 Oct 28 16:17 ..
drwxr-xr-x   7 sebastiaan  staff  224 Oct 28 16:17 bin
drwxr-xr-x   4 sebastiaan  staff  128 Oct 28 16:17 cli-plugins
drwxr-xr-x   6 sebastiaan  staff  192 Oct 28 16:17 completion
drwxr-xr-x   3 sebastiaan  staff   96 Oct 28 16:17 man
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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

1 participant