Refactor Dockerfiles a bit to make resulting images smaller