I'm trying to create a Docker secret as per Docker docs:
$ echo | docker secret create my_secret -
and getting the following:
$ echo 'this is my secret' | docker secret create my-secret -
Error reading content from "-": Incorrect function.
This is running under Docker Toolbox in ConEmu:
$ docker version
Client:
Version: 17.07.0-ce
API version: 1.31
Go version: go1.8.3
Git commit: 8784753
Built: Tue Aug 29 17:41:05 2017
OS/Arch: windows/amd64
Server:
Version: 17.09.0-ce
API version: 1.32 (minimum version 1.12)
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:45:38 2017
OS/Arch: linux/amd64
Experimental: false
The behavior manifests itself only for the STDIN option, the command works fine for a file:
$ docker secret create my_secret ./secret.txt
ulec3yck5jpwywg6o7ptxnun7
$ openssl rand -base64 32 | docker secret create secure-secret -
Error reading content from "-": Incorrect function.
$ echo "mydatabasepassword" | docker secret create db_pass -
Error reading content from "-": Incorrect function.
Related
I am trying to run jenkins swarm agent using the docker-compose provided here.
Issue is I am using a service account provided by my admin team to authenticate against jenkins master and the password for the service account contains special characters \ (backslash) and / (forward slash). Example:
abcdefghifjd12\ab/
The docker secret I created using this password doesn't work. I tried with my personal account which doesn't have any special characters and this works as expected. So I believe issue is with how docker is interpreting these special characters when creating secrets. I tried escaping the back slash and using single quotes for the password but doesn't work. I tried below
#use password as it is in double quotes
echo "abcdefghifjd12\ab/" | docker secret create jenkins-user -
#use backslash to escape backslash
echo "abcdefghifjd12\\ab/" | docker secret create jenkins-user -
#use single quotes
echo 'abcdefghifjd12\ab/' | docker secret create jenkins-user -
None worked. How do I resolve this issue?
Server:
Version: 17.06.2-ee-6
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: e75fdb8
Built: Mon Nov 27 22:44:25 2017
OS/Arch: linux/amd64
Experimental: false
With docker upgraded version I was able to do the same thing.
On SWARM I create a secret on manager-1:
[manager1] (local) root#192.168.0.41 ~
$ echo "abcdefghifjd12\ab/" | docker secret create jenkins-user -
jxykdlqklpo5ml81c4bfa9a4o
[manager1] (local) root#192.168.0.41 ~
$ docker service create --secret jenkins-user alpine sleep 1d
sgmrof1cwwubmhz1qqibu4aof
overall progress: 1 out of 1 tasks
1/1: running
verify: Service converged
[manager1] (local) root#192.168.0.41 ~
$ docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
sgmrof1cwwub wizardly_boyd replicated 1/1 alpine:latest
[manager1] (local) root#192.168.0.41 ~
[manager2] (local) root#192.168.0.43 ~
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f4552c4718c5 alpine:latest "sleep 1d" 2 minutes ago Up 2 minutes wizardly_boyd.1.4gb4nwgiqagfyn10vuvt9pb4v
[manager2] (local) root#192.168.0.43 ~
$ docker exec -it f45 sh
/ # cd /run
/run # cd secrets/
/run/secrets # ls
jenkins-user
/run/secrets # cat jenkins-user
abcdefghifjd12\ab/
Docker Version information:
$ docker version
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.2
Git commit: 9ee9f40
Built: Thu Apr 26 07:12:25 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:23:03 2018
OS/Arch: linux/amd64
Experimental: true
[manager1] (local) root#192.168.0.41 ~
On Gentoo Linux kernel 4.12.12
added docker info and version below
docker info : https://pastebin.com/Ph9ibMna
> docker version
Client:
Version: 17.06.2-ce
API version: 1.27 (downgraded from 1.30)
Go version: go1.8.3
Git commit: cec0b72
Built: Thu Sep 28 07:14:33 2017
OS/Arch: linux/amd64
Server:
Version: 17.03.2-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.8.3
Git commit: f5ec1e2
Built: Wed Sep 13 23:43:20 2017
OS/Arch: linux/amd64
Experimental: false
command:
> docker build -t some-test .
Sending build context to Docker daemon 234.9MB
Step 1/1 : FROM golang:1.7.3 as builder
Error parsing reference: "golang:1.7.3 as builder" is not a valid repository/tag: invalid reference format
from Dockerfile:
FROM golang:1.7.3 as builder
example taken from name-your-build-stages
The issue is your client is 17.06.2-ce and server is 17.03.2-ce. Multi stage build came in 17.06 i believe, so you need that version on the server. It is the server that processes the build. The client will only send the information to the server
So upgrade your server and it will work fine
I am using the docker docs to create a swarm
https://docs.docker.com/engine/swarm/swarm-tutorial/create-swarm/
[centos#dsm-manager1 ~]$ docker swarm init --advertise-addr 10.192.10.220
Error response from daemon: --live-restore daemon configuration is incompatible with swarm mode
[centos#dsm-manager1 ~]$
The version of docker I'm using
[centos#dsm-manager1 ~]$ docker version
Client:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-11.el7.centos.x86_64
Go version: go1.7.4
Git commit: 96d83a5/1.12.6
Built: Tue Mar 7 09:23:34 2017
OS/Arch: linux/amd64
Server:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-11.el7.centos.x86_64
Go version: go1.7.4
Git commit: 96d83a5/1.12.6
Built: Tue Mar 7 09:23:34 2017
OS/Arch: linux/amd64
The doc version is 1.17,I don't know whether this matters,
I just can't find the doc about swarm mode in version 1.12
For those who can’t find /etc/docker/daemon.json try /etc/sysconfig/docker
live-restore option is there:
OPTIONS=’–selinux-enabled --log-driver=journald --live-restore’
I am trying to use docker cp to copy .class files from my host into the container. I am using the following command:
docker cp foo.class container:/path/foo.class
I am doing this when the server running inside the container is shutdown.
However, I am seeing that the foo.class isn't getting updated with my latest file and if I try to rm the file I get a
rm: cannot remove foo.class: Stale file handle
Here is my docker version (Docker for Mac):
docker version
Client:
Version: 1.13.0
API version: 1.25
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: darwin/amd64
Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: linux/amd64
Experimental: true
Anyone seen this happen?
TIA
$ docker-compose up
Creating network "app_default" with the default driver
ERROR: b'failed to parse pool request for address space "LocalDefault" pool "" subpool "": could not find an available predefined network'
What is the meaning of this error, and how can I fix it?
Additional context:
$ docker-compose version
docker-compose version 1.7.1, build 6c29830
docker-py version: 1.8.1
CPython version: 3.5.1
OpenSSL version: OpenSSL 1.0.2h 3 May 2016
$ docker version
Client:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 21:49:11 2016
OS/Arch: darwin/amd64
Server:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Wed Apr 27 00:34:20 2016
OS/Arch: linux/amd64
Are you using some vpn service?
Here is a link to a possible reason:
https://github.com/docker/libnetwork/issues/779
I was having this problem. Solved by removing all docker defined networks with:
docker network rm `docker network ls -q`