Skip to content

Instantly share code, notes, and snippets.

$ coverage run --branch /usr/bin/py.test tests
============================= test session starts ==============================
platform linux2 -- Python 2.7.13, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
rootdir: /home/twaugh/devel/koji-containerbuild, inifile:
plugins: pep8-1.0.6, cov-2.4.0, capturelog-0.7
collected 42 items
tests/test_kcb.py .......................F..................
=================================== FAILURES ===================================
$ mkdir /tmp/x
$ pushd /tmp/x
/tmp/x ~
$ echo FROM scratch > Dockerfile
$ sudo python3
Python 3.6.2 (default, Jul 19 2017, 13:09:21)
[GCC 7.1.1 20170622 (Red Hat 7.1.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
>>> response = docker.APIClient().build(path='.', stream=True, decode=True)
@twaugh
twaugh / docker info
Created May 10, 2016 13:08
'docker info' from an environment where 'ADD *.tar.xz /' works for xattrs (RPi2 with F23)
# docker info
Containers: 1
Images: 1
Server Version: 1.9.1
Storage Driver: devicemapper
Pool Name: docker-docker--pool
Pool Blocksize: 524.3 kB
Base Device Size: 107.4 GB
Backing Filesystem: xfs
Data file:
@twaugh
twaugh / gist:6b656e9dc8e0db12394b
Created March 11, 2016 16:38
squash traceback
# cat Dockerfile
FROM fedora
RUN dnf install -y ghostscript-core
RUN dnf install -y ghostscript-cups
CMD /bin/env
LABEL foo=bar
# docker history test
IMAGE CREATED CREATED BY SIZE COMMENT
368d9c088d14 2 minutes ago /bin/sh -c #(nop) LABEL foo=bar 0 B
5c94a39d6eba 2 minutes ago /bin/sh -c #(nop) CMD ["/bin/sh" "-c" "/bin/e 0 B
@twaugh
twaugh / gist:ac6e7a9df99e0e0fcb85
Created March 11, 2016 16:32
More squash testing
# cat Dockerfile
FROM fedora
RUN dnf install -y ghostscript-core
CMD /bin/env
LABEL foo=bar
# docker history test
IMAGE CREATED CREATED BY SIZE COMMENT
22eda7db9190 About a minute ago /bin/sh -c #(nop) LABEL foo=bar 0 B
caf22047c227 About a minute ago /bin/sh -c #(nop) CMD ["/bin/sh" "-c" "/bin/e 0 B
fc675bf644f1 About a minute ago /bin/sh -c dnf install -y ghostscript-core 199.5 MB
# docker build -t test --rm .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM fedora
---> ddd5c9c1d0f2
Step 2 : RUN touch /tmp/test1
---> Running in 67eb98984603
---> 4183e0008378
Removing intermediate container 67eb98984603
Step 3 : RUN touch /tmp/test2
---> Running in 61f742cdb8dc
@twaugh
twaugh / gist:cbb920475ace8450de1d
Created February 2, 2016 15:34
This is the example Content Generator metadata for a v1+v2 import from running the test_koji_promote test (`py.test -k koji_promote -s`)
{
"build": {
"end_time": 1454339091,
"extra": {
"image": {}
},
"name": "name",
"release": "1",
"source": "git://hostname/path#123456",
"start_time": 1437985440,
Task pulp.server.managers.repo.sync.sync[a7dc43a2-242a-4fce-91e0-0e62d1215c11] raised unexpected: IOError(2, 'No such file or directory')
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 328, in __call__
return super(Task, self).__call__(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
return self.run(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/sync.py", line 110, in sync
call_config)
@twaugh
twaugh / gist:00cdc200d2aa309166a4
Created December 2, 2015 14:08
What docker 1.10 makes of jboss/wildfly:latest
[tim@localhost ~]$ sudo docker inspect jboss/wildfly:latest
[
{
"Id": "sha256:6d658fcccab0b6ccd4a63e212ede86a68a908fbc7bc9ef3ff60831578f604d65",
"RepoTags": [
"jboss/wildfly:latest"
],
"RepoDigests": [],
"Parent": "",
"Comment": "",
@twaugh
twaugh / metadata.json
Last active October 30, 2015 14:59
This is the example Content Generator metadata for a metadata-only import from running the test_koji_promote test (`py.test -k koji_promote -s`)
{
"build": {
"end_time": 1446217063,
"extra": {
"image": {}
},
"metadata_only": true,
"name": "name",
"release": "1",
"source": "git://hostname/path#123456",