我有一个本地docker映像,名称为CREATE OR REPLACE PROCEDURE MULTI_INSERT
IS
--Variable for rowtype (I assigned only one for all tables, because they have same construction - size and columns - just different names)
TYPE aa IS TABLE OF Table1%ROWTYPE INDEX BY PLS_INTEGER;
my_insert aa;
--Dates
first_day DATE;
this_day DATE := SYSDATE;
--Variable for deleting tables & checking if table has rows
No_of_records NUMBER;
Delete_tables VARCHAR(5):= to_char(SYSDATE, 'dd.mm');
BEGIN
--Delete tables in January
IF Delete_tables = '10.01' THEN
EXECUTE IMMEDIATE 'TRUNCATE TABLE Table1';
EXECUTE IMMEDIATE 'TRUNCATE TABLE Table2';
EXECUTE IMMEDIATE 'TRUNCATE TABLE Table3';
EXECUTE IMMEDIATE 'TRUNCATE TABLE Table4';
EXECUTE IMMEDIATE 'TRUNCATE TABLE Table5';
EXECUTE IMMEDIATE 'TRUNCATE TABLE Table6';
END IF;
BEGIN --Insert of 1st table
--check number of records - function
No_of_records :=empty_table('Table1');
IF No_of_records = 1 then
SELECT MAX(DATUM) +1 into first_day FROM Table1;
ELSIF No_of_records = 0 then
SELECT TRUNC(SYSDATE,'YEAR') "First Day" INTO first_day FROM Dual ;
END IF;
SELECT... --queries are different in each BEGIN END block !
FORALL i IN 1..my_insert.LAST
INSERT INTO Table1 (Name,Surname,Address,Join_Year,Start_Date)
VALUES(my_insert(i).Name,my_insert(i).Surname,my_insert(i).Address,my_insert(i).join_Year,my_insert(i).Start_Date);
COMMIT;
END;
BEGIN
--...And so on...Same code, just different queries for inserts into different tables...
COMMIT;
END;
END MULTI_INSERT;
/
。我的img_test
文件是:
docker-compose.yml
我也有version: '2'
services:
img_test:
image: img_test:latest
ports:
- "8080:80"
mysql:
image: mysql:latest
ports:
- "3636:3036"
nvidia/cuda:
image: nvidia/cuda:latest
runtime: nvidia
command: nvidia-smi
networks:
appnet:
external: true
。当我运行命令Dockerfile
时,它将引发此错误。
docker-compose up
我给了另外一个名字,例如ERROR: The Compose file './docker-compose.yml' is invalid because:
Invalid service name 'img_test' - only [a-zA-Z0-9\._\-] characters are allowed
,img/test
,但是它们不起作用。
我还尝试通过此命令在imgtest
文件中构建Dockerfile
。
docker-compose.yml
它为version: '2'
services:
app:
build: .
给出了相同的错误。
解决方案是什么?我是app
的新手。我测试了我的图像,它工作正常。我不想将我的映像推送到Dockerhub。还有另一种解决此问题的方法吗?
答案 0 :(得分:1)
这是相对较旧的docker-compose版本。他们过去有这个错误。尝试升级。