While all of Djibouti was shutting down last weekend preparing to celebrate this little country's independence from France, a solitary ship continued to work in the harbor - an Israeli freighter, the Dahlia, out of Haifa, with the Star of David fluttering over the stern.

That ship symbolized the uncomfortable situation that Djibouti's new leaders have put themselves in, with their commitment to enroll Djibouti in the Arab league and support Arab policies on Middle East issues.

Israeli's commercial shipping line, Zim, is a major customer of the port and railroad that represent Djibouti's only economic assets. Even the money that Israeli sailors spend on shore leave is said to be important.

How to reconcile their determined Arabism with their need to keep the Israelis coming in is one of the most complicated issues facing the government of President Hasan Gouled Aptidon.

Gouled has said in the past that he thought it possible to have it both ways. But since his election in May, he has appealed to Saudi Arabia and Egypt for aid to impoverished Djibouti. Diplomats here find it difficult to believe that either would provide much assistance to a state that proclaimed itself Arab but allowed Israeli-flag ships to keep up their lucrative operations.

"This is a very peculiar situation," puzzled diplomatic observer said.

Robert Galley, France's minister of cooperation who represented Paris at the independence ceremonies, we asked if France had given Israel any guarantees about use of the port. "That's not our problem. That is the problem of the Djibouti government," he replied.

He said Djibouti would join the United Nations, which means it would adhere to the U.N. Charter's principle of freedom of navigation in international waters.

But freedom of navigation through the mouth of the Red Sea, by the narrow Bab el Mandeb strait between Djibouti and South Yemen, is not the issue.

The question is not whether an Arab Djibouti would attempt to deny passage through the strait to Israeli ships, which all agree is out of the question even in the event of an Arab-Israeli war, but whether it can risk the damage to its own economy and the anger of Ethiopia that would come from excluding the Israelis from Djibouti harbor. According to French figures, the port already operates at a slight loss.

Zim is understood to be a major carrier of goods for Ethiopia, which has been using the port of Djibouti for most of its international trade since secessionist rebellion in its Red Sea province, Eritrea, restricted Ethiopia's use of its own ports.

Ahmed Dini Ahmed, president of the Djibouti National Assembly and regarded by many here as Djibouti's future leader, said in an interview: "Our policy toward Israel will be that of the Arab League. I would think that Israel cannot go on operating out of the port." But he acknowledged that the loss of Israeli business might be a severe blow to the economy and worsen the crushing unemployment problem Djibouti already faces.

"Nobody has asked us to leave," said Zim's agent here, Eleutherios Andreas. He said about 15 Zim ships a month call here, and estimated that this is 30-per cent of the port's traffic.

His biggest problem, he said, is not in Djibouti but inside Ethiopia, where pro-somali rebels have cut the single-track rail line that links Djibouti to Addis Ababa.The line has been cut nearly a month.

With the railroad out of operation, Zim has been delivering Ethiopia-bound cargo to Assab, Ethiopia's Red Sea port in Eritrea, Andrea said.

"Our contract calls for us to deliver the goods to Ethiopia," he said. "And we do that. How to get it from Assab to Addis Ababa, that's the Ethiopians' problem."

Except for Ethiopia, all of Djibouti's neighbors on both sides of the Red Sea are Arab. All cargo unloaded by Zim here is marked either for Ethiopia or Djibouti. But it is apparent that at least some of the goods brought here in Israeli-flag ships is actually destined for Arab countries, particularly South Yemen, and is merely transshipped out of here under new labels.