0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Liberty20.0.0.11で/config/dropinsがビルドにはなく起動時に生成される

Posted at

先月は問題なく使っていたDockerfileがビルドできなくなり。。

$ cat Dockerfile
FROM open-liberty
RUN mkdir /config/dropins/app.war
ADD hello.jsp /config/dropins/app.war/
$ docker build -t test .
略
STEP 1: FROM open-liberty
STEP 2: RUN mkdir /config/dropins/app.war
mkdir: cannot create directory ‘/config/dropins/app.war’: No such file or directory
略

たしかにNo such file or directoryでした。
(mkdirの「-p」を端折らなければよかった)

$ cat Dockerfile
FROM open-liberty
RUN ls -l /config
RUN ls -l /opt/ol/wlp/usr/servers/defaultServer
RUN mkdir -p /config/dropins/app.war
$ docker build -t test .
Sending build context to Docker daemon  11.78kB
Step 1/4 : FROM open-liberty
 ---> d9c569e91c0f
Step 2/4 : RUN ls -l /config
 ---> Running in 86b86fa3273c
lrwxrwxrwx. 1 default root 37 Nov 10 00:28 /config -> /opt/ol/wlp/usr/servers/defaultServer
Removing intermediate container 86b86fa3273c
 ---> ab3fc83dad56
Step 3/4 : RUN ls -l /opt/ol/wlp/usr/servers/defaultServer
 ---> Running in d8605ca18d65
total 12
drwxrwxr-x. 4 default root 4096 Nov 10 00:28 configDropins
-rw-rw----. 1 default root   41 Nov 10 00:28 server.env
-rw-rw----. 1 default root 1768 Nov 10 00:28 server.xml
Removing intermediate container d8605ca18d65
 ---> 2e59bc0045ad
Step 4/4 : RUN mkdir -p /config/dropins/app.war
 ---> Running in 6a5ab3627efa
Removing intermediate container 6a5ab3627efa
 ---> b2b21cf5e262
Successfully built b2b21cf5e262
Successfully tagged test:latest
$

今 2020年11月のlatestは 20.0.0.11
20.0.0.10まではdropinsあったのですが。
(タグを端折らなければよかった)

$ cat Dockerfile
FROM open-liberty:20.0.0.10-full-java8-openj9
RUN ls -l /config
RUN ls -l /opt/ol/wlp/usr/servers/defaultServer
RUN mkdir /config/dropins/app.war
$ docker build -t test .
Sending build context to Docker daemon  11.78kB
Step 1/4 : FROM open-liberty:20.0.0.10-full-java8-openj9
 ---> 0720bc6c6ef2
Step 2/4 : RUN ls -l /config
 ---> Running in cd923ea86863
lrwxrwxrwx. 1 default root 37 Oct  7 22:27 /config -> /opt/ol/wlp/usr/servers/defaultServer
Removing intermediate container cd923ea86863
 ---> 6dbe11d624cc
Step 3/4 : RUN ls -l /opt/ol/wlp/usr/servers/defaultServer
 ---> Running in 2fbce99e649c
total 20
drwxrwx---. 1 default root 4096 Oct  7 22:27 apps
drwxrwxr-x. 4 default root 4096 Oct  7 22:27 configDropins
drwxrwx---. 1 default root 4096 Oct  7 22:27 dropins
-rw-rw----. 1 default root   41 Oct  7 22:27 server.env
-rw-rw----. 1 default root 1768 Oct  7 22:27 server.xml
Removing intermediate container 2fbce99e649c
 ---> 4b6955b1f3f4
Step 4/4 : RUN mkdir /config/dropins/app.war
 ---> Running in 1b20af245ea2
Removing intermediate container 1b20af245ea2
 ---> adae5c3fbe06
Successfully built adae5c3fbe06
Successfully tagged test:latest
$

20.0.0.11も起動すればdropinsができている。

$ docker run -d --name=app open-liberty
1a059a7a687e7b77928d836135a180107ab981f2f85f4ae8e8ea33f9cef7c4a6
$ docker exec -it app ls -l /opt/ol/wlp/usr/servers/defaultServer
total 24
drwxrwxr-x. 1 default root 4096 Nov 10 00:28 configDropins
drwxr-x---. 2 default root 4096 Nov 12 18:56 dropins
-rw-rw----. 1 default root   41 Nov 10 00:28 server.env
-rw-rw----. 1 default root 1768 Nov 10 00:28 server.xml
$
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?