Building from Dockerfile
docker build [directory with Dockerfile]
RUN dnf install -y java-1.8.0-openjdk git maven mc vim unzip \
&& cd /tmp && git clone https://github.com/wildfly-swarm/wildfly-swarm swarm
ENTRYPOINT mvn clean install
FROM specifies a parent image
RUN specifies a command that is run during the image build. The results of the command are stored in the image.
One can put multiple
RUNs in a Dockerfile, but each will result in a new layer/image. It makes sense if you have a part of RUN that you are unlikely to modify. This will result in reusing of the layer from the first build in the consecutive builds, thus speeding up your work.
ENTRYPOINT is executed after container start. It is executed regardless of any command provided by
If you don’t want to run the start-up code in the case a user provides some run command, use
One can mix ENTRYPOINT with CMD, more details about the two: http://goinbigdata.com/docker-run-vs-cmd-vs-entrypoint/
docker run [image name]
To get into container’s bash:
docker run -it [image name] bash
To resurrect a container:
commit a stopped container:
docker commit [container sha] tmp
Start the container (in the example below, overriding entrypoint, because it was already ran):
docker run -ti --entrypoint=/bin/bash tmp
Sharing files between host and container
Mounting a host directory into a container:
docker run -v [host directory]:[container directory] [image name]
Copying files from docker to host (may be working both ways in new versions):
docker cp [container]:[container file/directory] [host target]
If you encounter this issue, it’s a bug in phantomjs that prevents it from working properly when QT_QPA_PLATFORM environment variable is set.
The best way to solve this issue is to upgrade to the newest phantom, but if you cannot do it, you can unset the variable:
or give it an empty value, e.g.:
If you don’t want to type the command every time, you can one of the above to .bashrc or .profile
Here’s one of the related issues on GitHub: https://github.com/ariya/phantomjs/issues/14061
grep -r <search term> --include <file pattern> <folder to search in>
jmap -J-d64 -dump:live,format=b,file=[filename] [pid]
One can then import the dump to jprofiler or jvisualvm
To get an angular service in chrome console you can use:
This will get you a service object.
To get to angular scope, inspect an element, for which you want to get the scope and invoke: angular.element($0).scope()
Usually, to add a user to postgres, you have to run
psql as user
postgres and create user as such.
On Ubuntu it’s enough to let you log in as a newly created user to the DB, but it’s not enough on Fedora. Here psql responds with the error from the subject.
To fix it add the following line to pg_hba.conf (on F23: /var/lib/pgsql/data/pg_hba.conf):
local all all md5
Line above is for socket configuration. If you need IP access too, add:
host all all 127.0.0.1/32 md5
To decompress response in curl add:
--compressed to curl command.
To pretty print JSON response, pipe the result to:
python -m json.tool
All in one line:
$ curl --compressed "http://someUrl" | python -m json.tool