Closed lluked closed 4 years ago
I am new to docker but believe there may be a small mistake in tpotce/host/etc/systemd/tpot.service on line 23.
tpotce/host/etc/systemd/tpot.service
ExecStartPre=-/bin/bash -c 'docker rmi $(docker images | grep "<none>" | awk \'{print $3}\')'
executing
docker rmi $(docker images | grep "<none>" | awk \'{print $3}\')
in terminal results in
awk: 1: unexpected character ''' awk: line 2: missing } near end of file "docker rmi" requires at least 1 argument.
awk: 1: unexpected character '''
awk: line 2: missing } near end of file
"docker rmi" requires at least 1 argument.
I believe that the \ preceding {print $3}\ is not needed.
\
{print $3}\
so the line should be
ExecStartPre=-/bin/bash -c 'docker rmi $(docker images | grep "<none>" | awk '{print $3}\')'
This results in either removing <none> images or returning
<none>
"docker rmi" requires at least 1 argument. See 'docker rmi --help'.
See 'docker rmi --help'.
if no <none> images are present.
As I had no <none> images left for testing I downloaded several versions of alpine images and replaced grep "<none>" with grep "alpine" and executed
grep "<none>"
grep "alpine"
docker rmi $(docker images | grep "alpine" | awk \'{print $3}\')
this resulted in the error
docker rmi $(docker images | grep "alpine" | awk '{print $3}\')
successfully removed the images.
Again, I'm new to this so sorry if I'm incorrect
Running in systemd without \ before ' results in not executing the command correctly. At least in my tests.
systemd
'
Sorry that's probably the problem, I wasn't running through systemd.
I am new to docker but believe there may be a small mistake in
tpotce/host/etc/systemd/tpot.service
on line 23.ExecStartPre=-/bin/bash -c 'docker rmi $(docker images | grep "<none>" | awk \'{print $3}\')'
executing
docker rmi $(docker images | grep "<none>" | awk \'{print $3}\')
in terminal results in
awk: 1: unexpected character '''
awk: line 2: missing } near end of file
"docker rmi" requires at least 1 argument.
I believe that the
\
preceding{print $3}\
is not needed.so the line should be
ExecStartPre=-/bin/bash -c 'docker rmi $(docker images | grep "<none>" | awk '{print $3}\')'
This results in either removing
<none>
images or returning"docker rmi" requires at least 1 argument.
See 'docker rmi --help'.
if no
<none>
images are present.As I had no
<none>
images left for testing I downloaded several versions of alpine images and replacedgrep "<none>"
withgrep "alpine"
and executeddocker rmi $(docker images | grep "alpine" | awk \'{print $3}\')
this resulted in the error
awk: 1: unexpected character '''
awk: line 2: missing } near end of file
"docker rmi" requires at least 1 argument.
executing
docker rmi $(docker images | grep "alpine" | awk '{print $3}\')
successfully removed the images.
Again, I'm new to this so sorry if I'm incorrect