This content was deleted by the author. You can see it from Blockchain History logs.

Docker Log

Docker 에는 API가 있어서 다양한 작업들을 할 수가 있다.

원래 쓰려던 글은 굉장히 많은 삽질에 관한 내용이었는데, 아주 단순하게 가능한 방법을 찾아서.. 공유

const http = require('http');

const options = {
    socketPath: '/var/run/docker.sock',
    path: '/images/json',
};

const callback = res => {
    console.log(`STATUS: ${res.statusCode}`);
    res.setEncoding('utf8');
    res.on('data', data =>{
        console.log("DATA:", JSON.parse( "["+data+"]") )
    });
    res.on('error', data => console.error(data));
};

const clientRequest = http.request(options, callback);
clientRequest.end();

방법은 엄청 허무할정도.
내가 이걸 1달을 고생했다니.