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

Docker pull / push result doesn't look good. #160

Closed
shinebayar-g opened this issue Jan 15, 2019 · 10 comments
Closed

Docker pull / push result doesn't look good. #160

shinebayar-g opened this issue Jan 15, 2019 · 10 comments
Labels

Comments

@shinebayar-g
Copy link
Collaborator

I've this script that downloads new updates from git repository, then build and push docker image.
However docker pull step looks like this:
image
image
image
image

Rest of the script looks good. Only docker pull part is messed up.

@bugy
Copy link
Owner

bugy commented Jan 15, 2019

If you could send me the script log file (a part of it), it would be helpful.
Please make sure to keep line endings of this file

Also, could you tell please, how its supposed to look (in terminal)

@shinebayar-g
Copy link
Collaborator Author

shinebayar-g commented Jan 15, 2019

Where can I find logs? Does it write logs somewhere default or do I have to enable it?

I'll include screenshot of terminal soon.

@bugy
Copy link
Owner

bugy commented Jan 15, 2019

They are in script-server/logs/processes

@shinebayar-g shinebayar-g changed the title Docker pull result doesn't look good. Docker pull / push result doesn't look good. Jan 15, 2019
@shinebayar-g
Copy link
Collaborator Author

Here is how docker pull command looks like, I had to record screen. Because screenshot wouldn't make sense.

https://drive.google.com/file/d/1OHttttYqhQVhJX0hyP0abeHMXaAjMkGZ/view (I'll delete video after few days).
PS: This is not from actual script that I was running.
PS2: Also If script only contains simple command like docker pull ubuntu:16.04 it doesn't happen.

My script is like this:

#!/bin/bash
now=$(date +"%T")

# Pull changes
echo "$now : Changing directory to github repository"
cd /home/user/admin/github/repository

echo "$now : Pulling update from master"
git pull origin master

echo "$now : Updating image repo/image:1.5.1"
docker pull repo/image:1.5.1

echo "$now : Building image repo/image:latest"
docker build -t repo/image:latest -f Dockerfile . || { echo "couldn't build docker image" ; exit 1; }

echo "$now : Pushing image repo/image:latest"
docker push repo/image:latest

Here is logs, If I cat this file it shows normal on terminal, but if I open it with vim i get this:

>>>>>  OUTPUT STARTED <<<<<
12:55:41 : Changing directory to github repository
12:55:41 : Pulling update from master
From https://github.com/user/repo
 * branch            master     -> FETCH_HEAD
Already up to date.
12:55:41 : Updating image repo/image:1.5.1
1.5.1: Pulling from repo/image
Digest: sha256:a1f0d88eeb87a73fcf08e62d65ddbeadf00ce7e7ec74f63974bb9adddf2f34f5
Status: Image is up to date for repo/image:1.5.1
12:55:41 : Building image repo/image:latest
Sending build context to Docker daemon  557.1kB^MSending build context to Docker daemon  3.006MB^M^M
Step 1/19 : FROM repo/image:1.5.1 as build-deps
 ---> 772f15e28f4a


....


Step 9/19 : RUN meteor npm install --save
 ---> Running in f48d07c5e673
^[[91mnpm^[[0m^[[91m ^[[0m^[[91mWARN^[[0m^[[91m ^[[0m^[[91mdeprecated^[[0m^[[91m [email protected]: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
^[[0m^[[91mnpm^[[0m^[[91m ^[[0m^[[91mWARN^[[0m^[[91m ^[[0m^[[91mdeprecated^[[0m^[[91m [email protected]: CircularJSON is in maintenance only, flatted is its successor.
^[[0m

Notice those ^M ^[ etc characters.

@bugy bugy added the feature label Jan 15, 2019
@bugy
Copy link
Owner

bugy commented Jan 15, 2019

I see, looks like ANSI codes, which are not 100% supported yet (basically only formatting). I will have a look closer later. You can delete the video now, I made a copy for myself.
Thank you!

@shinebayar-g
Copy link
Collaborator Author

@bugy Is it possible to support dynamic outputs from commands? I mean look at my docker pull example.
It doesn't put wall of texts onto terminal, instead it reuses its previous outputs' lines. Docker pull example:
First it shows Pulling fs layer then it becomes Downloading ==> then it becomes Extracting finally it becomes Extract complete.

Also npm install uses this method while install node modules. If it's possible to support this dynamic output it would be great.

@bugy
Copy link
Owner

bugy commented Jan 16, 2019

I have a task for it: #134. Didn't have time to work on it yet

@shinebayar-g
Copy link
Collaborator Author

Ah, good to know. Take your time man, you're awesome.

@bugy
Copy link
Owner

bugy commented Aug 17, 2019

Hi, @shinebayar-g could you check please if the output looks good for you now? I made quite a lot of improvements to the output

@shinebayar-g
Copy link
Collaborator Author

Hi @bugy, Just tested with latest dev release. You really made lot of improvements there! It looks exact same as terminal output. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants